From 2d2d1c07f403a82895f491dc44d3afe02633eb25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 27 Feb 2013 22:49:26 +0100 Subject: [PATCH] Using new type aliases in whole root Magnum namespace. --- src/AbstractShaderProgram.cpp | 46 ++--- src/AbstractShaderProgram.h | 232 ++++++++++++------------- src/AbstractTexture.cpp | 8 +- src/AbstractTexture.h | 16 +- src/Array.h | 16 +- src/BufferImage.cpp | 2 +- src/BufferImage.h | 10 +- src/BufferTexture.h | 2 +- src/Color.h | 4 +- src/Context.h | 10 +- src/CubeMapTexture.h | 12 +- src/CubeMapTextureArray.h | 18 +- src/DefaultFramebuffer.cpp | 2 +- src/DefaultFramebuffer.h | 2 +- src/DimensionTraits.h | 26 +-- src/Framebuffer.cpp | 4 +- src/Framebuffer.h | 12 +- src/Image.cpp | 2 +- src/Image.h | 12 +- src/ImageWrapper.h | 12 +- src/Magnum.h | 22 +-- src/Mesh.cpp | 2 +- src/Mesh.h | 48 ++--- src/Query.cpp | 16 +- src/Query.h | 32 ++-- src/Renderer.h | 28 +-- src/Resource.h | 2 +- src/ResourceManager.h | 12 +- src/Test/AbstractShaderProgramTest.cpp | 8 +- src/Test/ColorTest.cpp | 10 +- src/Test/ResourceManagerTest.cpp | 24 +-- src/Test/SwizzleTest.cpp | 16 +- src/Texture.h | 16 +- src/Timeline.cpp | 4 +- src/Timeline.h | 14 +- 35 files changed, 351 insertions(+), 351 deletions(-) diff --git a/src/AbstractShaderProgram.cpp b/src/AbstractShaderProgram.cpp index b8a3c03f1..b5f09a957 100644 --- a/src/AbstractShaderProgram.cpp +++ b/src/AbstractShaderProgram.cpp @@ -29,16 +29,16 @@ namespace Magnum { #ifndef DOXYGEN_GENERATING_OUTPUT -static_assert(std::is_same::value, "GLubyte is not the same as std::uint8_t"); -static_assert(std::is_same::value, "GLbyte is not the same as std::int8_t"); -static_assert(std::is_same::value, "GLushort is not the same as std::uint16_t"); -static_assert(std::is_same::value, "GLshort is not the same as std::int16_t"); -static_assert(std::is_same::value, "GLuint is not the same as std::uint32_t"); -static_assert(std::is_same::value, "GLint is not the same as std::int32_t"); -static_assert(std::is_same::value, "GLsizei is not the same as std::int32_t"); -static_assert(std::is_same::value, "GLfloat is not the same as float"); +static_assert(std::is_same::value, "GLubyte is not the same as UnsignedByte"); +static_assert(std::is_same::value, "GLbyte is not the same as Byte"); +static_assert(std::is_same::value, "GLushort is not the same as UnsignedShort"); +static_assert(std::is_same::value, "GLshort is not the same as Short"); +static_assert(std::is_same::value, "GLuint is not the same as UnsignedInt"); +static_assert(std::is_same::value, "GLint is not the same as Int"); +static_assert(std::is_same::value, "GLsizei is not the same as Int"); +static_assert(std::is_same::value, "GLfloat is not the same as Float"); #ifndef MAGNUM_TARGET_GLES -static_assert(std::is_same::value, "GLdouble is not the same as double"); +static_assert(std::is_same::value, "GLdouble is not the same as Double"); #endif #endif @@ -86,7 +86,7 @@ AbstractShaderProgram::UniformMatrix3x4dvImplementation AbstractShaderProgram::u AbstractShaderProgram::UniformMatrix4x3dvImplementation AbstractShaderProgram::uniformMatrix4x3dvImplementation = &AbstractShaderProgram::uniformImplementationDefault; #endif -GLint AbstractShaderProgram::maxSupportedVertexAttributeCount() { +Int AbstractShaderProgram::maxSupportedVertexAttributeCount() { GLint& value = Context::current()->state()->shaderProgram->maxSupportedVertexAttributeCount; /* Get the value, if not already cached */ @@ -121,19 +121,19 @@ bool AbstractShaderProgram::attachShader(Shader& shader) { return true; } -void AbstractShaderProgram::bindAttributeLocation(GLuint location, const std::string& name) { +void AbstractShaderProgram::bindAttributeLocation(UnsignedInt location, const std::string& name) { CORRADE_ASSERT(state == Initialized, "AbstractShaderProgram: attribute cannot be bound after linking.", ); glBindAttribLocation(_id, location, name.c_str()); } #ifndef MAGNUM_TARGET_GLES -void AbstractShaderProgram::bindFragmentDataLocation(GLuint location, const std::string& name) { +void AbstractShaderProgram::bindFragmentDataLocation(UnsignedInt location, const std::string& name) { CORRADE_ASSERT(state == Initialized, "AbstractShaderProgram: fragment data location cannot be bound after linking.", ); glBindFragDataLocation(_id, location, name.c_str()); } -void AbstractShaderProgram::bindFragmentDataLocationIndexed(GLuint location, GLuint index, const std::string& name) { +void AbstractShaderProgram::bindFragmentDataLocationIndexed(UnsignedInt location, UnsignedInt index, const std::string& name) { CORRADE_ASSERT(state == Initialized, "AbstractShaderProgram: fragment data location cannot be bound after linking.", ); glBindFragDataLocationIndexed(_id, location, index, name.c_str()); @@ -169,7 +169,7 @@ void AbstractShaderProgram::link() { state = status == GL_FALSE ? Failed : Linked; } -GLint AbstractShaderProgram::uniformLocation(const std::string& name) { +Int AbstractShaderProgram::uniformLocation(const std::string& name) { /** @todo What if linking just failed (not programmer error?) */ CORRADE_ASSERT(state == Linked, "AbstractShaderProgram: uniform location cannot be retrieved before linking.", -1); @@ -640,7 +640,7 @@ std::size_t DoubleAttribute::size(GLint components, DataType dataType) { } #endif -std::size_t Attribute>::size(GLint components, DataType dataType) { +std::size_t Attribute>::size(GLint components, DataType dataType) { #ifndef MAGNUM_TARGET_GLES if(components == GL_BGRA) components = 4; #endif @@ -749,18 +749,18 @@ Debug operator<<(Debug debug, SizedMatrixAttribute<4>::Components value) { return debug << "AbstractShaderProgram::Attribute::Components::(invalid)"; } -Debug operator<<(Debug debug, Attribute>::Components value) { +Debug operator<<(Debug debug, Attribute>::Components value) { switch(value) { - case Attribute>::Components::One: + case Attribute>::Components::One: return debug << "AbstractShaderProgram::Attribute::Components::One"; - case Attribute>::Components::Two: + case Attribute>::Components::Two: return debug << "AbstractShaderProgram::Attribute::Components::Two"; - case Attribute>::Components::Three: + case Attribute>::Components::Three: return debug << "AbstractShaderProgram::Attribute::Components::Three"; - case Attribute>::Components::Four: + case Attribute>::Components::Four: return debug << "AbstractShaderProgram::Attribute::Components::Four"; #ifndef MAGNUM_TARGET_GLES - case Attribute>::Components::BGRA: + case Attribute>::Components::BGRA: return debug << "AbstractShaderProgram::Attribute::Components::BGRA"; #endif } @@ -817,9 +817,9 @@ Debug operator<<(Debug debug, DoubleAttribute::DataType value) { } #endif -Debug operator<<(Debug debug, Attribute>::DataType value) { +Debug operator<<(Debug debug, Attribute>::DataType value) { switch(value) { - #define _c(value) case Attribute>::DataType::value: return debug << "AbstractShaderProgram::Attribute::DataType::" #value; + #define _c(value) case Attribute>::DataType::value: return debug << "AbstractShaderProgram::Attribute::DataType::" #value; _c(UnsignedByte) _c(Byte) _c(UnsignedShort) diff --git a/src/AbstractShaderProgram.h b/src/AbstractShaderProgram.h index c38b7de4a..658281fa6 100644 --- a/src/AbstractShaderProgram.h +++ b/src/AbstractShaderProgram.h @@ -52,7 +52,7 @@ typedef Attribute<2, Vector2> TextureCoordinates; @endcode - **Output attribute locations**, if desired, for example: @code -enum: GLuint { +enum: UnsignedInt { ColorOutput = 0, NormalOutput = 1 }; @@ -60,7 +60,7 @@ enum: GLuint { - **Layers for texture uniforms** to which the textures will be bound before rendering, for example: @code -enum: GLint { +enum: Int { DiffuseTextureLayer = 0, SpecularTextureLayer = 1 }; @@ -68,7 +68,7 @@ enum: GLint { - **Uniform locations** for setting uniform data (see below) (private variables), for example: @code -GLint TransformationUniform = 0, +Int TransformationUniform = 0, ProjectionUniform = 1, DiffuseTextureUniform = 2, SpecularTextureUniform = 3; @@ -164,8 +164,8 @@ layout(location = 1) uniform mat4 projection; If you don't have the required extension, you can get uniform location using uniformLocation() after linking stage: @code -GLint transformationUniform = uniformLocation("transformation"); -GLint projectionUniform = uniformLocation("projection"); +Int transformationUniform = uniformLocation("transformation"); +Int projectionUniform = uniformLocation("projection"); @endcode @requires_gl43 %Extension @extension{ARB,explicit_uniform_location} for @@ -185,16 +185,16 @@ layout(binding = 1) uniform sampler2D specularTexture; @endcode If you don't have the required extension (or if you want to change the layer -later), you can set the texture layer uniform using setUniform(GLint, GLint): +later), you can set the texture layer uniform using setUniform(Int, Int): @code setUniform(DiffuseTextureUniform, DiffuseTextureLayer); setUniform(SpecularTextureUniform, SpecularTextureLayer); @endcode @requires_gl42 %Extension @extension{ARB,shading_language_420pack} for explicit - texture layer binding instead of using setUniform(GLint, GLint). + texture layer binding instead of using setUniform(Int, Int). @requires_gl Explicit texture layer binding is not supported in OpenGL ES. Use - setUniform(GLint, GLint) instead. + setUniform(Int, Int) instead. @section AbstractShaderProgram-rendering-workflow Rendering workflow @@ -204,7 +204,7 @@ for more information) and map shader outputs to framebuffer attachments if needed (see @ref Framebuffer-usage "Framebuffer documentation" for more information). In each draw event set uniforms, mark the shader for use, bind specific framebuffer (if needed) and bind required textures to their -respective layers using AbstractTexture::bind(GLint). Then call Mesh::draw(). +respective layers using AbstractTexture::bind(Int). Then call Mesh::draw(). Example: @code shader->setTransformation(transformation) @@ -252,7 +252,7 @@ are cached, so repeated queries don't result in repeated @fn_gl{Get} calls. If extension @extension{ARB,separate_shader_objects} or @extension{EXT,direct_state_access} is available, uniform setting functions use DSA functions to avoid unnecessary calls to @fn_gl{UseProgram}. See -setUniform(GLint, GLfloat) documentation for more information. +setUniform() documentation for more information. To achieve least state changes, set all uniforms in one run -- method chaining comes in handy. @@ -293,9 +293,9 @@ class MAGNUM_EXPORT AbstractShaderProgram { * shaders and @ref Mesh-configuration for example usage when adding * vertex buffers to mesh. */ - template class Attribute { + template class Attribute { public: - enum: GLuint { + enum: UnsignedInt { Location = location /**< Location to which the attribute is bound */ }; @@ -424,7 +424,7 @@ class MAGNUM_EXPORT AbstractShaderProgram { * @see DataOptions, Attribute() */ #ifdef DOXYGEN_GENERATING_OUTPUT - enum class DataOption: std::uint8_t { + enum class DataOption: UnsignedByte { /** * Normalize integer components. Only for float attribute * types. Default is to not normalize. @@ -440,7 +440,7 @@ class MAGNUM_EXPORT AbstractShaderProgram { * @see Attribute() */ #ifdef DOXYGEN_GENERATING_OUTPUT - typedef typename Corrade::Containers::EnumSet DataOptions; + typedef typename Corrade::Containers::EnumSet DataOptions; #else typedef typename Implementation::Attribute::DataOptions DataOptions; #endif @@ -494,7 +494,7 @@ class MAGNUM_EXPORT AbstractShaderProgram { * OpenGL calls. * @see Attribute, @fn_gl{Get} with @def_gl{MAX_VERTEX_ATTRIBS} */ - static GLint maxSupportedVertexAttributeCount(); + static Int maxSupportedVertexAttributeCount(); /** * @brief Constructor @@ -590,7 +590,7 @@ class MAGNUM_EXPORT AbstractShaderProgram { * for more information. * @see @fn_gl{BindAttribLocation} */ - void bindAttributeLocation(GLuint location, const std::string& name); + void bindAttributeLocation(UnsignedInt location, const std::string& name); #ifndef MAGNUM_TARGET_GLES /** @@ -613,7 +613,7 @@ class MAGNUM_EXPORT AbstractShaderProgram { * @requires_gl Multiple blend function inputs are not available in * OpenGL ES. */ - void bindFragmentDataLocationIndexed(GLuint location, GLuint index, const std::string& name); + void bindFragmentDataLocationIndexed(UnsignedInt location, UnsignedInt index, const std::string& name); /** * @brief Bind fragment data to given location and first color input index @@ -627,7 +627,7 @@ class MAGNUM_EXPORT AbstractShaderProgram { * @requires_gl Use explicit location specification in OpenGL ES 3.0 * instead. */ - void bindFragmentDataLocation(GLuint location, const std::string& name); + void bindFragmentDataLocation(UnsignedInt location, const std::string& name); #endif /** @@ -651,7 +651,7 @@ class MAGNUM_EXPORT AbstractShaderProgram { * for more information. * @see @fn_gl{GetUniformLocation} */ - GLint uniformLocation(const std::string& name); + Int uniformLocation(const std::string& name); /** * @brief Set uniform value @@ -664,265 +664,265 @@ class MAGNUM_EXPORT AbstractShaderProgram { * @see @fn_gl{UseProgram}, @fn_gl{Uniform} or `glProgramUniform()` * from @extension{ARB,separate_shader_objects}/@extension{EXT,direct_state_access}. */ - inline void setUniform(GLint location, GLfloat value) { + inline void setUniform(Int location, Float value) { (this->*uniform1fImplementation)(location, value); } - /** @copydoc setUniform(GLint, GLfloat) */ - inline void setUniform(GLint location, const Math::Vector<2, GLfloat>& value) { + /** @copydoc setUniform(Int, Float) */ + inline void setUniform(Int location, const Math::Vector<2, Float>& value) { (this->*uniform2fvImplementation)(location, value); } - /** @copydoc setUniform(GLint, GLfloat) */ - inline void setUniform(GLint location, const Math::Vector<3, GLfloat>& value) { + /** @copydoc setUniform(Int, Float) */ + inline void setUniform(Int location, const Math::Vector<3, Float>& value) { (this->*uniform3fvImplementation)(location, value); } - /** @copydoc setUniform(GLint, GLfloat) */ - inline void setUniform(GLint location, const Math::Vector<4, GLfloat>& value) { + /** @copydoc setUniform(Int, Float) */ + inline void setUniform(Int location, const Math::Vector<4, Float>& value) { (this->*uniform4fvImplementation)(location, value); } - /** @copydoc setUniform(GLint, GLfloat) */ - inline void setUniform(GLint location, GLint value) { + /** @copydoc setUniform(Int, Float) */ + inline void setUniform(Int location, Int value) { (this->*uniform1iImplementation)(location, value); } - /** @copydoc setUniform(GLint, GLfloat) */ - inline void setUniform(GLint location, const Math::Vector<2, GLint>& value) { + /** @copydoc setUniform(Int, Float) */ + inline void setUniform(Int location, const Math::Vector<2, Int>& value) { (this->*uniform2ivImplementation)(location, value); } - /** @copydoc setUniform(GLint, GLfloat) */ - inline void setUniform(GLint location, const Math::Vector<3, GLint>& value) { + /** @copydoc setUniform(Int, Float) */ + inline void setUniform(Int location, const Math::Vector<3, Int>& value) { (this->*uniform3ivImplementation)(location, value); } - /** @copydoc setUniform(GLint, GLfloat) */ - inline void setUniform(GLint location, const Math::Vector<4, GLint>& value) { + /** @copydoc setUniform(Int, Float) */ + inline void setUniform(Int location, const Math::Vector<4, Int>& value) { (this->*uniform4ivImplementation)(location, value); } #ifndef MAGNUM_TARGET_GLES2 /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gl30 %Extension @extension{EXT,gpu_shader4} * @requires_gles30 Only signed integers are available in OpenGL ES 2.0. */ - inline void setUniform(GLint location, GLuint value) { + inline void setUniform(Int location, UnsignedInt value) { (this->*uniform1uiImplementation)(location, value); } /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gl30 %Extension @extension{EXT,gpu_shader4} * @requires_gles30 Only signed integers are available in OpenGL ES 2.0. */ - inline void setUniform(GLint location, const Math::Vector<2, GLuint>& value) { + inline void setUniform(Int location, const Math::Vector<2, UnsignedInt>& value) { (this->*uniform2uivImplementation)(location, value); } /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gl30 %Extension @extension{EXT,gpu_shader4} * @requires_gles30 Only signed integers are available in OpenGL ES 2.0. */ - inline void setUniform(GLint location, const Math::Vector<3, GLuint>& value) { + inline void setUniform(Int location, const Math::Vector<3, UnsignedInt>& value) { (this->*uniform3uivImplementation)(location, value); } /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gl30 %Extension @extension{EXT,gpu_shader4} * @requires_gles30 Only signed integers are available in OpenGL ES 2.0. */ - inline void setUniform(GLint location, const Math::Vector<4, GLuint>& value) { + inline void setUniform(Int location, const Math::Vector<4, UnsignedInt>& value) { (this->*uniform4uivImplementation)(location, value); } #endif #ifndef MAGNUM_TARGET_GLES /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gl40 %Extension @extension{ARB,gpu_shader_fp64} * @requires_gl Only floats are available in OpenGL ES. */ - inline void setUniform(GLint location, GLdouble value) { + inline void setUniform(Int location, Double value) { (this->*uniform1dImplementation)(location, value); } /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gl40 %Extension @extension{ARB,gpu_shader_fp64} * @requires_gl Only floats are available in OpenGL ES. */ - inline void setUniform(GLint location, const Math::Vector<2, GLdouble>& value) { + inline void setUniform(Int location, const Math::Vector<2, Double>& value) { (this->*uniform2dvImplementation)(location, value); } /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gl40 %Extension @extension{ARB,gpu_shader_fp64} * @requires_gl Only floats are available in OpenGL ES. */ - inline void setUniform(GLint location, const Math::Vector<3, GLdouble>& value) { + inline void setUniform(Int location, const Math::Vector<3, Double>& value) { (this->*uniform3dvImplementation)(location, value); } /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gl40 %Extension @extension{ARB,gpu_shader_fp64} * @requires_gl Only floats are available in OpenGL ES. */ - inline void setUniform(GLint location, const Math::Vector<4, GLdouble>& value) { + inline void setUniform(Int location, const Math::Vector<4, Double>& value) { (this->*uniform4dvImplementation)(location, value); } #endif - /** @copydoc setUniform(GLint, GLfloat) */ - inline void setUniform(GLint location, const Math::Matrix<2, GLfloat>& value) { + /** @copydoc setUniform(Int, Float) */ + inline void setUniform(Int location, const Math::Matrix<2, Float>& value) { (this->*uniformMatrix2fvImplementation)(location, value); } - /** @copydoc setUniform(GLint, GLfloat) */ - inline void setUniform(GLint location, const Math::Matrix<3, GLfloat>& value) { + /** @copydoc setUniform(Int, Float) */ + inline void setUniform(Int location, const Math::Matrix<3, Float>& value) { (this->*uniformMatrix3fvImplementation)(location, value); } - /** @copydoc setUniform(GLint, GLfloat) */ - inline void setUniform(GLint location, const Math::Matrix<4, GLfloat>& value) { + /** @copydoc setUniform(Int, Float) */ + inline void setUniform(Int location, const Math::Matrix<4, Float>& value) { (this->*uniformMatrix4fvImplementation)(location, value); } #ifndef MAGNUM_TARGET_GLES2 /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gles30 Only square matrices are available in OpenGL ES 2.0. */ - inline void setUniform(GLint location, const Math::RectangularMatrix<2, 3, GLfloat>& value) { + inline void setUniform(Int location, const Math::RectangularMatrix<2, 3, Float>& value) { (this->*uniformMatrix2x3fvImplementation)(location, value); } /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gles30 Only square matrices are available in OpenGL ES 2.0. */ - inline void setUniform(GLint location, const Math::RectangularMatrix<3, 2, GLfloat>& value) { + inline void setUniform(Int location, const Math::RectangularMatrix<3, 2, Float>& value) { (this->*uniformMatrix3x2fvImplementation)(location, value); } /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gles30 Only square matrices are available in OpenGL ES 2.0. */ - inline void setUniform(GLint location, const Math::RectangularMatrix<2, 4, GLfloat>& value) { + inline void setUniform(Int location, const Math::RectangularMatrix<2, 4, Float>& value) { (this->*uniformMatrix2x4fvImplementation)(location, value); } /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gles30 Only square matrices are available in OpenGL ES 2.0. */ - inline void setUniform(GLint location, const Math::RectangularMatrix<4, 2, GLfloat>& value) { + inline void setUniform(Int location, const Math::RectangularMatrix<4, 2, Float>& value) { (this->*uniformMatrix4x2fvImplementation)(location, value); } /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gles30 Only square matrices are available in OpenGL ES 2.0. */ - inline void setUniform(GLint location, const Math::RectangularMatrix<3, 4, GLfloat>& value) { + inline void setUniform(Int location, const Math::RectangularMatrix<3, 4, Float>& value) { (this->*uniformMatrix3x4fvImplementation)(location, value); } /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gles30 Only square matrices are available in OpenGL ES 2.0. */ - inline void setUniform(GLint location, const Math::RectangularMatrix<4, 3, GLfloat>& value) { + inline void setUniform(Int location, const Math::RectangularMatrix<4, 3, Float>& value) { (this->*uniformMatrix4x3fvImplementation)(location, value); } #endif #ifndef MAGNUM_TARGET_GLES /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gl40 %Extension @extension{ARB,gpu_shader_fp64} * @requires_gl Only floats are available in OpenGL ES. */ - inline void setUniform(GLint location, const Math::Matrix<2, GLdouble>& value) { + inline void setUniform(Int location, const Math::Matrix<2, Double>& value) { (this->*uniformMatrix2dvImplementation)(location, value); } /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gl40 %Extension @extension{ARB,gpu_shader_fp64} * @requires_gl Only floats are available in OpenGL ES. */ - inline void setUniform(GLint location, const Math::Matrix<3, GLdouble>& value) { + inline void setUniform(Int location, const Math::Matrix<3, Double>& value) { (this->*uniformMatrix3dvImplementation)(location, value); } /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gl40 %Extension @extension{ARB,gpu_shader_fp64} * @requires_gl Only floats are available in OpenGL ES. */ - inline void setUniform(GLint location, const Math::Matrix<4, GLdouble>& value) { + inline void setUniform(Int location, const Math::Matrix<4, Double>& value) { (this->*uniformMatrix4dvImplementation)(location, value); } /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gl40 %Extension @extension{ARB,gpu_shader_fp64} * @requires_gl Only floats are available in OpenGL ES. */ - inline void setUniform(GLint location, const Math::RectangularMatrix<2, 3, GLdouble>& value) { + inline void setUniform(Int location, const Math::RectangularMatrix<2, 3, Double>& value) { (this->*uniformMatrix2x3dvImplementation)(location, value); } /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gl40 %Extension @extension{ARB,gpu_shader_fp64} * @requires_gl Only floats are available in OpenGL ES. */ - inline void setUniform(GLint location, const Math::RectangularMatrix<3, 2, GLdouble>& value) { + inline void setUniform(Int location, const Math::RectangularMatrix<3, 2, Double>& value) { (this->*uniformMatrix3x2dvImplementation)(location, value); } /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gl40 %Extension @extension{ARB,gpu_shader_fp64} * @requires_gl Only floats are available in OpenGL ES. */ - inline void setUniform(GLint location, const Math::RectangularMatrix<2, 4, GLdouble>& value) { + inline void setUniform(Int location, const Math::RectangularMatrix<2, 4, Double>& value) { (this->*uniformMatrix2x4dvImplementation)(location, value); } /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gl40 %Extension @extension{ARB,gpu_shader_fp64} * @requires_gl Only floats are available in OpenGL ES. */ - inline void setUniform(GLint location, const Math::RectangularMatrix<4, 2, GLdouble>& value) { + inline void setUniform(Int location, const Math::RectangularMatrix<4, 2, Double>& value) { (this->*uniformMatrix4x2dvImplementation)(location, value); } /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gl40 %Extension @extension{ARB,gpu_shader_fp64} * @requires_gl Only floats are available in OpenGL ES. */ - inline void setUniform(GLint location, const Math::RectangularMatrix<3, 4, GLdouble>& value) { + inline void setUniform(Int location, const Math::RectangularMatrix<3, 4, Double>& value) { (this->*uniformMatrix3x4dvImplementation)(location, value); } /** - * @copydoc setUniform(GLint, GLfloat) + * @copydoc setUniform(Int, Float) * @requires_gl40 %Extension @extension{ARB,gpu_shader_fp64} * @requires_gl Only floats are available in OpenGL ES. */ - inline void setUniform(GLint location, const Math::RectangularMatrix<4, 3, GLdouble>& value) { + inline void setUniform(Int location, const Math::RectangularMatrix<4, 3, Double>& value) { (this->*uniformMatrix4x3dvImplementation)(location, value); } #endif @@ -1175,7 +1175,7 @@ template struct Attribute; /* Base for float attributes */ struct FloatAttribute { - typedef GLfloat Type; + typedef Float Type; enum class DataType: GLenum { UnsignedByte = GL_UNSIGNED_BYTE, @@ -1198,10 +1198,10 @@ struct FloatAttribute { }; constexpr static DataType DefaultDataType = DataType::Float; - enum class DataOption: std::uint8_t { + enum class DataOption: UnsignedByte { Normalized = 1 << 0 }; - typedef Corrade::Containers::EnumSet DataOptions; + typedef Corrade::Containers::EnumSet DataOptions; static std::size_t MAGNUM_EXPORT size(GLint components, DataType dataType); }; @@ -1213,7 +1213,7 @@ Debug MAGNUM_EXPORT operator<<(Debug debug, FloatAttribute::DataType value); #ifndef MAGNUM_TARGET_GLES2 /* Base for int attributes */ struct IntAttribute { - typedef GLint Type; + typedef Int Type; enum class DataType: GLenum { UnsignedByte = GL_UNSIGNED_BYTE, @@ -1225,8 +1225,8 @@ struct IntAttribute { }; constexpr static DataType DefaultDataType = DataType::Int; - enum class DataOption: std::uint8_t {}; - typedef Corrade::Containers::EnumSet DataOptions; + enum class DataOption: UnsignedByte {}; + typedef Corrade::Containers::EnumSet DataOptions; static std::size_t MAGNUM_EXPORT size(GLint components, DataType dataType); }; @@ -1235,13 +1235,13 @@ Debug MAGNUM_EXPORT operator<<(Debug debug, IntAttribute::DataType value); /* Base for unsigned int attributes */ struct UnsignedIntAttribute { - typedef GLuint Type; + typedef UnsignedInt Type; typedef IntAttribute::DataType DataType; constexpr static DataType DefaultDataType = DataType::UnsignedInt; typedef IntAttribute::DataOption DataOption; - typedef Corrade::Containers::EnumSet DataOptions; + typedef Corrade::Containers::EnumSet DataOptions; inline static std::size_t size(GLint components, DataType dataType) { return IntAttribute::size(components, dataType); @@ -1252,15 +1252,15 @@ struct UnsignedIntAttribute { #ifndef MAGNUM_TARGET_GLES /* Base for double attributes */ struct DoubleAttribute { - typedef GLdouble Type; + typedef Double Type; enum class DataType: GLenum { Double = GL_DOUBLE }; constexpr static DataType DefaultDataType = DataType::Double; - enum class DataOption: std::uint8_t {}; - typedef Corrade::Containers::EnumSet DataOptions; + enum class DataOption: UnsignedByte {}; + typedef Corrade::Containers::EnumSet DataOptions; static std::size_t MAGNUM_EXPORT size(GLint components, DataType dataType); }; @@ -1269,8 +1269,8 @@ Debug MAGNUM_EXPORT operator<<(Debug debug, DoubleAttribute::DataType value); #endif /* Floating-point four-component vector is absolutely special case */ -template<> struct Attribute> { - typedef GLfloat Type; +template<> struct Attribute> { + typedef Float Type; enum class Components: GLint { One = 1, @@ -1309,39 +1309,39 @@ template<> struct Attribute> { }; constexpr static DataType DefaultDataType = DataType::Float; - enum class DataOption: std::uint8_t { + enum class DataOption: UnsignedByte { Normalized = 1 << 0 }; - typedef Corrade::Containers::EnumSet DataOptions; + typedef Corrade::Containers::EnumSet DataOptions; inline constexpr static std::size_t vectorCount() { return 1; } static std::size_t MAGNUM_EXPORT size(GLint components, DataType dataType); }; -typedef Math::Vector<4, GLfloat> _Vector4; +typedef Math::Vector<4, Float> _Vector4; CORRADE_ENUMSET_OPERATORS(Attribute<_Vector4>::DataOptions) -Debug MAGNUM_EXPORT operator<<(Debug debug, Attribute>::Components value); -Debug MAGNUM_EXPORT operator<<(Debug debug, Attribute>::DataType value); +Debug MAGNUM_EXPORT operator<<(Debug debug, Attribute>::Components value); +Debug MAGNUM_EXPORT operator<<(Debug debug, Attribute>::DataType value); /* Common float, int, unsigned int and double scalar attributes */ -template<> struct Attribute: FloatAttribute, SizedAttribute<1, 1> {}; +template<> struct Attribute: FloatAttribute, SizedAttribute<1, 1> {}; #ifndef MAGNUM_TARGET_GLES2 -template<> struct Attribute: IntAttribute, SizedAttribute<1, 1> {}; -template<> struct Attribute: UnsignedIntAttribute, SizedAttribute<1, 1> {}; +template<> struct Attribute: IntAttribute, SizedAttribute<1, 1> {}; +template<> struct Attribute: UnsignedIntAttribute, SizedAttribute<1, 1> {}; #ifndef MAGNUM_TARGET_GLES -template<> struct Attribute: DoubleAttribute, SizedAttribute<1, 1> {}; +template<> struct Attribute: DoubleAttribute, SizedAttribute<1, 1> {}; #endif #endif /* Common float, int, unsigned int and double vector attributes */ -template struct Attribute>: FloatAttribute, SizedAttribute<1, size_> {}; +template struct Attribute>: FloatAttribute, SizedAttribute<1, size_> {}; #ifndef MAGNUM_TARGET_GLES2 -template struct Attribute>: IntAttribute, SizedAttribute<1, size_> {}; -template struct Attribute>: UnsignedIntAttribute, SizedAttribute<1, size_> {}; +template struct Attribute>: IntAttribute, SizedAttribute<1, size_> {}; +template struct Attribute>: UnsignedIntAttribute, SizedAttribute<1, size_> {}; #ifndef MAGNUM_TARGET_GLES -template struct Attribute>: DoubleAttribute, SizedAttribute<1, size_> {}; +template struct Attribute>: DoubleAttribute, SizedAttribute<1, size_> {}; #endif #endif template struct Attribute>: Attribute> {}; @@ -1351,15 +1351,15 @@ template struct Attribute>: Attribute> {}; template struct Attribute>: Attribute> {}; /* Common float and double rectangular matrix attributes */ -template struct Attribute>: FloatAttribute, SizedAttribute {}; +template struct Attribute>: FloatAttribute, SizedAttribute {}; #ifndef MAGNUM_TARGET_GLES -template struct Attribute>: DoubleAttribute, SizedAttribute {}; +template struct Attribute>: DoubleAttribute, SizedAttribute {}; #endif /* Common float and double square matrix attributes */ -template struct Attribute>: Attribute> {}; +template struct Attribute>: Attribute> {}; #ifndef MAGNUM_TARGET_GLES -template struct Attribute>: Attribute> {}; +template struct Attribute>: Attribute> {}; #endif template struct Attribute>: Attribute> {}; template struct Attribute>: Attribute> {}; diff --git a/src/AbstractTexture.cpp b/src/AbstractTexture.cpp index 7fe72dca1..440b3820d 100644 --- a/src/AbstractTexture.cpp +++ b/src/AbstractTexture.cpp @@ -83,11 +83,11 @@ static_assert((filter_or(NearestNeighbor, BaseLevel) == GL_NEAREST) && #undef filter_or #endif -GLint AbstractTexture::maxSupportedLayerCount() { +Int AbstractTexture::maxSupportedLayerCount() { return Context::current()->state()->texture->maxSupportedLayerCount; } -GLfloat AbstractTexture::maxSupportedAnisotropy() { +Float AbstractTexture::maxSupportedAnisotropy() { GLfloat& value = Context::current()->state()->texture->maxSupportedAnisotropy; /** @todo Re-enable when extension header is available */ @@ -131,7 +131,7 @@ AbstractTexture& AbstractTexture::operator=(AbstractTexture&& other) { return *this; } -void AbstractTexture::bind(GLint layer) { +void AbstractTexture::bind(Int layer) { Implementation::TextureState* const textureState = Context::current()->state()->texture; /* If already bound in given layer, nothing to do */ @@ -453,7 +453,7 @@ void AbstractTexture::invalidateSubImplementationARB(GLint level, const Vector3i #ifndef DOXYGEN_GENERATING_OUTPUT #ifndef MAGNUM_TARGET_GLES2 namespace Implementation { - template const GLvoid* ImageHelper>::dataOrPixelUnpackBuffer(BufferImage* image) { + template const GLvoid* ImageHelper>::dataOrPixelUnpackBuffer(BufferImage* image) { image->buffer()->bind(Buffer::Target::PixelUnpack); return nullptr; } diff --git a/src/AbstractTexture.h b/src/AbstractTexture.h index 2ec6975dc..b1a6095ed 100644 --- a/src/AbstractTexture.h +++ b/src/AbstractTexture.h @@ -979,11 +979,11 @@ class MAGNUM_EXPORT AbstractTexture { * * The result is cached, repeated queries don't result in repeated * OpenGL calls. - * @see @ref AbstractShaderProgram-subclassing, bind(GLint), + * @see @ref AbstractShaderProgram-subclassing, bind(Int), * @fn_gl{Get} with @def_gl{MAX_COMBINED_TEXTURE_IMAGE_UNITS}, * @fn_gl{ActiveTexture} */ - static GLint maxSupportedLayerCount(); + static Int maxSupportedLayerCount(); /** * @brief Max supported anisotropy @@ -994,7 +994,7 @@ class MAGNUM_EXPORT AbstractTexture { * @requires_extension %Extension @extension{EXT,texture_filter_anisotropic} * @requires_es_extension %Extension @es_extension2{EXT,texture_filter_anisotropic,texture_filter_anisotropic} */ - static GLfloat maxSupportedAnisotropy(); + static Float maxSupportedAnisotropy(); #ifndef DOXYGEN_GENERATING_OUTPUT inline explicit AbstractTexture(GLenum target): _target(target) { @@ -1030,7 +1030,7 @@ class MAGNUM_EXPORT AbstractTexture { * @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} or * @fn_gl_extension{BindMultiTexture,EXT,direct_state_access} */ - void bind(GLint layer); + void bind(Int layer); /** * @brief Set minification filter @@ -1108,7 +1108,7 @@ class MAGNUM_EXPORT AbstractTexture { * @requires_extension %Extension @extension{EXT,texture_filter_anisotropic} * @requires_es_extension %Extension @es_extension2{EXT,texture_filter_anisotropic,texture_filter_anisotropic} */ - inline AbstractTexture* setMaxAnisotropy(GLfloat anisotropy) { + inline AbstractTexture* setMaxAnisotropy(Float anisotropy) { (this->*parameterfImplementation)(GL_TEXTURE_MAX_ANISOTROPY_EXT, anisotropy); return this; } @@ -1122,7 +1122,7 @@ class MAGNUM_EXPORT AbstractTexture { * @see @ref Texture::invalidateSubImage() "invalidateSubImage()", * @fn_gl{InvalidateTexImage} */ - inline void invalidateImage(GLint level) { + inline void invalidateImage(Int level) { (this->*invalidateImplementation)(level); } @@ -1142,7 +1142,7 @@ class MAGNUM_EXPORT AbstractTexture { protected: #ifndef DOXYGEN_GENERATING_OUTPUT - template struct DataHelper {}; + template struct DataHelper {}; /* Unlike bind() this also sets the binding layer as active */ void MAGNUM_LOCAL bindInternal(); @@ -1290,7 +1290,7 @@ namespace Implementation { }; #ifndef MAGNUM_TARGET_GLES2 - template struct MAGNUM_EXPORT ImageHelper> { + template struct MAGNUM_EXPORT ImageHelper> { static const GLvoid* dataOrPixelUnpackBuffer(BufferImage* image); }; #endif diff --git a/src/Array.h b/src/Array.h index 2788fcfc3..cfe5dfb28 100644 --- a/src/Array.h +++ b/src/Array.h @@ -37,10 +37,10 @@ need any math operations and fuzzy comparison (e.g. enum values). Unlike Math::Vector this class has non-explicit constructor from one value. @see Array1D, Array2D, Array3D */ -template class Array { +template class Array { public: typedef T Type; /**< @brief Data type */ - const static std::uint8_t Dimensions = dimensions; /**< @brief Dimension count */ + const static UnsignedInt Dimensions = dimensions; /**< @brief Dimension count */ /** * @brief Default constructor @@ -68,13 +68,13 @@ template class Array { * @param value Value for all fields */ template::value && dimensions != 1, U>::type> inline /*implicit*/ Array(U value) { - for(std::uint8_t i = 0; i != dimensions; ++i) + for(UnsignedInt i = 0; i != dimensions; ++i) _data[i] = value; } /** @brief Equality */ inline bool operator==(const Array& other) const { - for(std::uint8_t i = 0; i != dimensions; ++i) + for(UnsignedInt i = 0; i != dimensions; ++i) if(_data[i] != other._data[i]) return false; return true; } @@ -85,8 +85,8 @@ template class Array { } /** @brief Value at given position */ - inline T& operator[](std::uint8_t pos) { return _data[pos]; } - inline constexpr T operator[](std::uint8_t pos) const { return _data[pos]; } /**< @overload */ + inline T& operator[](UnsignedInt pos) { return _data[pos]; } + inline constexpr T operator[](UnsignedInt pos) const { return _data[pos]; } /**< @overload */ /** * @brief Raw data @@ -181,10 +181,10 @@ template class Array3D: public Array<3, T> { }; /** @debugoperator{Magnum::Array} */ -template Debug operator<<(Debug debug, const Array& value) { +template Debug operator<<(Debug debug, const Array& value) { debug << "Array("; debug.setFlag(Debug::SpaceAfterEachValue, false); - for(std::uint8_t i = 0; i != dimensions; ++i) { + for(UnsignedInt i = 0; i != dimensions; ++i) { if(i != 0) debug << ", "; debug << value[i]; } diff --git a/src/BufferImage.cpp b/src/BufferImage.cpp index 377b28e8b..ff2b8f5d9 100644 --- a/src/BufferImage.cpp +++ b/src/BufferImage.cpp @@ -18,7 +18,7 @@ namespace Magnum { #ifndef MAGNUM_TARGET_GLES2 -template void BufferImage::setData(const typename DimensionTraits::VectorType& size, Format format, Type type, const GLvoid* data, Buffer::Usage usage) { +template void BufferImage::setData(const typename DimensionTraits::VectorType& size, Format format, Type type, const GLvoid* data, Buffer::Usage usage) { _format = format; _type = type; _size = size; diff --git a/src/BufferImage.h b/src/BufferImage.h index 743f31dac..1e5998c07 100644 --- a/src/BufferImage.h +++ b/src/BufferImage.h @@ -37,9 +37,9 @@ Trade::ImageData. @see BufferImage1D, BufferImage2D, BufferImage3D, Buffer @requires_gles30 Pixel buffer objects are not available in OpenGL ES 2.0. */ -template class MAGNUM_EXPORT BufferImage: public AbstractImage { +template class MAGNUM_EXPORT BufferImage: public AbstractImage { public: - const static std::uint8_t Dimensions = dimensions; /**< @brief %Image dimension count */ + const static UnsignedInt Dimensions = dimensions; /**< @brief %Image dimension count */ /** * @brief Constructor @@ -54,7 +54,7 @@ template class MAGNUM_EXPORT BufferImage: public Abstra } /** @brief %Image size */ - inline typename DimensionTraits::VectorType size() const { return _size; } + inline typename DimensionTraits::VectorType size() const { return _size; } /** @brief %Image buffer */ inline Buffer* buffer() { return &_buffer; } @@ -72,10 +72,10 @@ template class MAGNUM_EXPORT BufferImage: public Abstra * * @see Buffer::setData() */ - void setData(const typename DimensionTraits::VectorType& size, Format format, Type type, const GLvoid* data, Buffer::Usage usage); + void setData(const typename DimensionTraits::VectorType& size, Format format, Type type, const GLvoid* data, Buffer::Usage usage); private: - Math::Vector _size; + Math::Vector _size; Buffer _buffer; }; diff --git a/src/BufferTexture.h b/src/BufferTexture.h index 4a6130fb1..cf697b094 100644 --- a/src/BufferTexture.h +++ b/src/BufferTexture.h @@ -197,7 +197,7 @@ class MAGNUM_EXPORT BufferTexture: private AbstractTexture { inline explicit BufferTexture(): AbstractTexture(GL_TEXTURE_BUFFER) {} /** @copydoc AbstractTexture::bind() */ - inline void bind(GLint layer) { AbstractTexture::bind(layer); } + inline void bind(Int layer) { AbstractTexture::bind(layer); } /** * @brief Set texture buffer diff --git a/src/Color.h b/src/Color.h index bb256994d..041b4be22 100644 --- a/src/Color.h +++ b/src/Color.h @@ -144,7 +144,7 @@ range @f$ [0.0, 1.0] @f$. #ifndef DOXYGEN_GENERATING_OUTPUT template #else -template +template #endif class Color3: public Math::Vector3 { public: @@ -267,7 +267,7 @@ See Color3 for more information. #ifndef DOXYGEN_GENERATING_OUTPUT template #else -template +template #endif class Color4: public Math::Vector4 { public: diff --git a/src/Context.h b/src/Context.h index 569ac877f..86cc209b6 100644 --- a/src/Context.h +++ b/src/Context.h @@ -39,7 +39,7 @@ namespace Implementation { @see Context, MAGNUM_ASSERT_VERSION_SUPPORTED() */ -enum class Version: GLint { +enum class Version: Int { None = 0xFFFF, /**< @brief Unspecified */ #ifndef MAGNUM_TARGET_GLES GL210 = 210, /**< @brief OpenGL 2.1 / GLSL 1.20 */ @@ -166,7 +166,7 @@ class MAGNUM_EXPORT Context { * @see minorVersion(), version(), versionString(), * shadingLanguageVersionString() */ - inline GLint majorVersion() const { return _majorVersion; } + inline Int majorVersion() const { return _majorVersion; } /** * @brief Minor OpenGL version (e.g. `3`) @@ -174,7 +174,7 @@ class MAGNUM_EXPORT Context { * @see majorVersion(), version(), versionString(), * shadingLanguageVersionString() */ - inline GLint minorVersion() const { return _minorVersion; } + inline Int minorVersion() const { return _minorVersion; } /** * @brief Vendor string @@ -293,8 +293,8 @@ class MAGNUM_EXPORT Context { static Context* _current; Version _version; - GLint _majorVersion; - GLint _minorVersion; + Int _majorVersion; + Int _minorVersion; std::bitset<128> extensionStatus; std::vector _supportedExtensions; diff --git a/src/CubeMapTexture.h b/src/CubeMapTexture.h index ed3a2c9d3..59c3d68c8 100644 --- a/src/CubeMapTexture.h +++ b/src/CubeMapTexture.h @@ -119,7 +119,7 @@ class CubeMapTexture: public AbstractTexture { * See Texture::imageSize() for more information. * @requires_gl %Texture image queries are not available in OpenGL ES. */ - inline Vector2i imageSize(Coordinate coordinate, GLint level) { + inline Vector2i imageSize(Coordinate coordinate, Int level) { return DataHelper<2>::imageSize(this, static_cast(coordinate), level); } #endif @@ -129,7 +129,7 @@ class CubeMapTexture: public AbstractTexture { * * See Texture::setStorage() for more information. */ - inline CubeMapTexture* setStorage(GLsizei levels, InternalFormat internalFormat, const Vector2i& size) { + inline CubeMapTexture* setStorage(Int levels, InternalFormat internalFormat, const Vector2i& size) { DataHelper<2>::setStorage(this, _target, levels, internalFormat, size); return this; } @@ -145,7 +145,7 @@ class CubeMapTexture: public AbstractTexture { * * See Texture::setImage() for more information. */ - template inline CubeMapTexture* setImage(Coordinate coordinate, GLint level, InternalFormat internalFormat, Image* image) { + template inline CubeMapTexture* setImage(Coordinate coordinate, Int level, InternalFormat internalFormat, Image* image) { DataHelper<2>::set(this, static_cast(coordinate), level, internalFormat, image); return this; } @@ -161,7 +161,7 @@ class CubeMapTexture: public AbstractTexture { * * See Texture::setSubImage() for more information. */ - template inline CubeMapTexture* setSubImage(Coordinate coordinate, GLint level, const Vector2i& offset, const Image* image) { + template inline CubeMapTexture* setSubImage(Coordinate coordinate, Int level, const Vector2i& offset, const Image* image) { DataHelper<2>::setSub(this, static_cast(coordinate), level, offset, image); return this; } @@ -178,7 +178,7 @@ class CubeMapTexture: public AbstractTexture { * * See Texture::invalidateSubImage() for more information. */ - inline void invalidateSubImage(GLint level, const Vector3i& offset, const Vector3i& size) { + inline void invalidateSubImage(Int level, const Vector3i& offset, const Vector3i& size) { DataHelper<3>::invalidateSub(this, level, offset, size); } @@ -198,7 +198,7 @@ class CubeMapTexture: public AbstractTexture { return this; } #endif - inline CubeMapTexture* setMaxAnisotropy(GLfloat anisotropy) { + inline CubeMapTexture* setMaxAnisotropy(Float anisotropy) { AbstractTexture::setMaxAnisotropy(anisotropy); return this; } diff --git a/src/CubeMapTextureArray.h b/src/CubeMapTextureArray.h index d6b25f3af..2a6ffb35c 100644 --- a/src/CubeMapTextureArray.h +++ b/src/CubeMapTextureArray.h @@ -106,7 +106,7 @@ class CubeMapTextureArray: public AbstractTexture { * * See Texture::imageSize() for more information. */ - inline Vector3i imageSize(Coordinate coordinate, GLint level) { + inline Vector3i imageSize(Coordinate coordinate, Int level) { return DataHelper<3>::imageSize(this, GL_TEXTURE_CUBE_MAP_POSITIVE_X + static_cast(coordinate), level); } @@ -115,7 +115,7 @@ class CubeMapTextureArray: public AbstractTexture { * * See Texture::setStorage() for more information. */ - inline CubeMapTextureArray* setStorage(GLsizei levels, InternalFormat internalFormat, const Vector3i& size) { + inline CubeMapTextureArray* setStorage(Int levels, InternalFormat internalFormat, const Vector3i& size) { DataHelper<3>::setStorage(this, _target, levels, internalFormat, size); return this; } @@ -134,7 +134,7 @@ class CubeMapTextureArray: public AbstractTexture { * * See Texture::setImage() for more information. */ - template inline CubeMapTextureArray* setImage(GLint level, InternalFormat internalFormat, T* image) { + template inline CubeMapTextureArray* setImage(Int level, InternalFormat internalFormat, T* image) { DataHelper<3>::set(this, GL_TEXTURE_CUBE_MAP_ARRAY, level, internalFormat, image); return this; } @@ -156,9 +156,9 @@ class CubeMapTextureArray: public AbstractTexture { * * See Texture::setSubImage() for more information. * - * @see setSubImage(GLsizei, Coordinate, GLint, const Math::Vector<2, GLint>&, const Image*) + * @see setSubImage(Int, Coordinate, Int, const Math::Vector<2, Int>&, const Image*) */ - template inline CubeMapTextureArray* setSubImage(GLint level, const Vector3i& offset, const Image* image) { + template inline CubeMapTextureArray* setSubImage(Int level, const Vector3i& offset, const Image* image) { DataHelper<3>::setSub(this, GL_TEXTURE_CUBE_MAP_ARRAY, level, offset, image, Vector3i(Math::Vector())); return this; } @@ -175,9 +175,9 @@ class CubeMapTextureArray: public AbstractTexture { * * See Texture::setSubImage() for more information. * - * @see setSubImage(GLint, const Math::Vector<3, GLint>&, const Image*) + * @see setSubImage(Int, const Math::Vector<3, Int>&, const Image*) */ - template inline CubeMapTextureArray* setSubImage(GLsizei layer, Coordinate coordinate, GLint level, const Vector2i& offset, const Image* image) { + template inline CubeMapTextureArray* setSubImage(Int layer, Coordinate coordinate, Int level, const Vector2i& offset, const Image* image) { DataHelper<3>::setSub(this, GL_TEXTURE_CUBE_MAP_ARRAY, level, Vector3i(offset, layer*6+static_cast(coordinate)), image, Vector2i(Math::Vector())); return this; } @@ -194,7 +194,7 @@ class CubeMapTextureArray: public AbstractTexture { * * See Texture::invalidateSubImage() for more information. */ - inline void invalidateSubImage(GLint level, const Vector3i& offset, const Vector3i& size) { + inline void invalidateSubImage(Int level, const Vector3i& offset, const Vector3i& size) { DataHelper<3>::invalidateSub(this, level, offset, size); } @@ -212,7 +212,7 @@ class CubeMapTextureArray: public AbstractTexture { AbstractTexture::setBorderColor(color); return this; } - inline CubeMapTextureArray* setMaxAnisotropy(GLfloat anisotropy) { + inline CubeMapTextureArray* setMaxAnisotropy(Float anisotropy) { AbstractTexture::setMaxAnisotropy(anisotropy); return this; } diff --git a/src/DefaultFramebuffer.cpp b/src/DefaultFramebuffer.cpp index dac3e572a..6a0d40899 100644 --- a/src/DefaultFramebuffer.cpp +++ b/src/DefaultFramebuffer.cpp @@ -28,7 +28,7 @@ DefaultFramebuffer defaultFramebuffer; DefaultFramebuffer::DefaultFramebuffer() { _id = 0; } #ifndef MAGNUM_TARGET_GLES2 -void DefaultFramebuffer::mapForDraw(std::initializer_list> attachments) { +void DefaultFramebuffer::mapForDraw(std::initializer_list> attachments) { /* Max attachment location */ std::size_t max = 0; for(const auto& attachment: attachments) diff --git a/src/DefaultFramebuffer.h b/src/DefaultFramebuffer.h index 8548809df..6bbb736bd 100644 --- a/src/DefaultFramebuffer.h +++ b/src/DefaultFramebuffer.h @@ -282,7 +282,7 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer { * @requires_gles30 Draw attachments for default framebuffer are * available only in OpenGL ES 3.0. */ - void mapForDraw(std::initializer_list> attachments); + void mapForDraw(std::initializer_list> attachments); /** * @brief Map shader output to buffer attachment diff --git a/src/DimensionTraits.h b/src/DimensionTraits.h index 71785aa3e..eb790dbe0 100644 --- a/src/DimensionTraits.h +++ b/src/DimensionTraits.h @@ -24,7 +24,7 @@ namespace Magnum { /** @brief Matrix, point and vector specializations for given dimension count */ -template struct DimensionTraits { +template struct DimensionTraits { DimensionTraits() = delete; #ifdef DOXYGEN_GENERATING_OUTPUT @@ -61,17 +61,17 @@ template struct DimensionTraits<2, T> { }; /* Two dimensions - floating-point */ -template<> struct DimensionTraits<2, float> { +template<> struct DimensionTraits<2, Float> { DimensionTraits() = delete; - typedef Math::Vector2 VectorType; - typedef Math::Matrix3 MatrixType; + typedef Math::Vector2 VectorType; + typedef Math::Matrix3 MatrixType; }; -template<> struct DimensionTraits<2, double> { +template<> struct DimensionTraits<2, Double> { DimensionTraits() = delete; - typedef Math::Vector2 VectorType; - typedef Math::Matrix3 MatrixType; + typedef Math::Vector2 VectorType; + typedef Math::Matrix3 MatrixType; }; /* Three dimensions - integral */ @@ -82,17 +82,17 @@ template struct DimensionTraits<3, T> { }; /* Three dimensions - floating-point */ -template<> struct DimensionTraits<3, float> { +template<> struct DimensionTraits<3, Float> { DimensionTraits() = delete; - typedef Math::Vector3 VectorType; - typedef Math::Matrix4 MatrixType; + typedef Math::Vector3 VectorType; + typedef Math::Matrix4 MatrixType; }; -template<> struct DimensionTraits<3, double> { +template<> struct DimensionTraits<3, Double> { DimensionTraits() = delete; - typedef Math::Vector3 VectorType; - typedef Math::Matrix4 MatrixType; + typedef Math::Vector3 VectorType; + typedef Math::Matrix4 MatrixType; }; #endif diff --git a/src/Framebuffer.cpp b/src/Framebuffer.cpp index 056a08cd9..629a24c9d 100644 --- a/src/Framebuffer.cpp +++ b/src/Framebuffer.cpp @@ -58,7 +58,7 @@ Framebuffer::~Framebuffer() { glDeleteFramebuffers(1, &_id); } -void Framebuffer::mapForDraw(std::initializer_list> attachments) { +void Framebuffer::mapForDraw(std::initializer_list> attachments) { /* Max attachment location */ std::size_t max = 0; for(const auto& attachment: attachments) @@ -94,7 +94,7 @@ void Framebuffer::invalidate(std::initializer_list attac delete _attachments; } -void Framebuffer::attachTexture2D(BufferAttachment attachment, Texture2D* texture, GLint mipLevel) { +void Framebuffer::attachTexture2D(BufferAttachment attachment, Texture2D* texture, Int mipLevel) { /** @todo Check for texture target compatibility */ (this->*texture2DImplementation)(attachment, GLenum(texture->target()), texture->id(), mipLevel); } diff --git a/src/Framebuffer.h b/src/Framebuffer.h index 8c4713876..706374210 100644 --- a/src/Framebuffer.h +++ b/src/Framebuffer.h @@ -105,7 +105,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer { * @brief Constructor * @param id Color attachment id */ - inline constexpr explicit ColorAttachment(std::uint8_t id): attachment(GL_COLOR_ATTACHMENT0 + id) {} + inline constexpr explicit ColorAttachment(UnsignedInt id): attachment(GL_COLOR_ATTACHMENT0 + id) {} #ifndef DOXYGEN_GENERATING_OUTPUT inline constexpr explicit operator GLenum() const { return attachment; } @@ -238,7 +238,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer { * @fn_gl_extension{FramebufferDrawBuffers,EXT,direct_state_access} * @requires_gles30 %Extension @es_extension2{NV,draw_buffers,GL_NV_draw_buffers} */ - void mapForDraw(std::initializer_list> attachments); + void mapForDraw(std::initializer_list> attachments); /** * @brief Map shader output to attachment @@ -333,7 +333,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer { * @fn_gl_extension{NamedFramebufferTexture1D,EXT,direct_state_access} * @requires_gl Only 2D and 3D textures are available in OpenGL ES. */ - inline void attachTexture1D(BufferAttachment attachment, Texture1D* texture, GLint level) { + inline void attachTexture1D(BufferAttachment attachment, Texture1D* texture, Int level) { (this->*texture1DImplementation)(attachment, texture, level); } #endif @@ -350,7 +350,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer { * @see attachCubeMapTexture(), @fn_gl{BindFramebuffer}, @fn_gl{FramebufferTexture} * or @fn_gl_extension{NamedFramebufferTexture2D,EXT,direct_state_access} */ - void attachTexture2D(BufferAttachment attachment, Texture2D* texture, GLint level); + void attachTexture2D(BufferAttachment attachment, Texture2D* texture, Int level); /** * @brief Attach cube map texture to given buffer @@ -365,7 +365,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer { * @see attachTexture2D(), @fn_gl{BindFramebuffer}, @fn_gl{FramebufferTexture} * or @fn_gl_extension{NamedFramebufferTexture2D,EXT,direct_state_access} */ - inline void attachCubeMapTexture(BufferAttachment attachment, CubeMapTexture* texture, CubeMapTexture::Coordinate coordinate, GLint level) { + inline void attachCubeMapTexture(BufferAttachment attachment, CubeMapTexture* texture, CubeMapTexture::Coordinate coordinate, Int level) { (this->*texture2DImplementation)(attachment, GLenum(coordinate), texture->id(), level); } @@ -383,7 +383,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer { * @fn_gl_extension{NamedFramebufferTexture3D,EXT,direct_state_access} * @requires_es_extension %Extension @es_extension{OES,texture_3D} */ - inline void attachTexture3D(BufferAttachment attachment, Texture3D* texture, GLint level, GLint layer) { + inline void attachTexture3D(BufferAttachment attachment, Texture3D* texture, Int level, Int layer) { /** @todo Check for texture target compatibility */ (this->*texture3DImplementation)(attachment, texture, level, layer); } diff --git a/src/Image.cpp b/src/Image.cpp index 2e04ce74f..b6c6921e2 100644 --- a/src/Image.cpp +++ b/src/Image.cpp @@ -17,7 +17,7 @@ namespace Magnum { -template void Image::setData(const typename DimensionTraits::VectorType& size, Format format, Type type, GLvoid* data) { +template void Image::setData(const typename DimensionTraits::VectorType& size, Format format, Type type, GLvoid* data) { delete[] _data; _format = format; _type = type; diff --git a/src/Image.h b/src/Image.h index 111a748f7..20c30cd13 100644 --- a/src/Image.h +++ b/src/Image.h @@ -32,9 +32,9 @@ Stores image data on client memory. Interchangeable with ImageWrapper, BufferImage or Trade::ImageData. @see Image1D, Image2D, Image3D */ -template class Image: public AbstractImage { +template class Image: public AbstractImage { public: - const static std::uint8_t Dimensions = dimensions; /**< @brief %Image dimension count */ + const static UnsignedInt Dimensions = dimensions; /**< @brief %Image dimension count */ /** * @brief Constructor @@ -46,7 +46,7 @@ template class Image: public AbstractImage { * Note that the image data are not copied on construction, but they * are deleted on class destruction. */ - inline explicit Image(const typename DimensionTraits::VectorType& size, Format format, Type type, GLvoid* data): AbstractImage(format, type), _size(size), _data(reinterpret_cast(data)) {} + inline explicit Image(const typename DimensionTraits::VectorType& size, Format format, Type type, GLvoid* data): AbstractImage(format, type), _size(size), _data(reinterpret_cast(data)) {} /** * @brief Constructor @@ -62,7 +62,7 @@ template class Image: public AbstractImage { inline ~Image() { delete[] _data; } /** @brief %Image size */ - inline typename DimensionTraits::VectorType size() const { return _size; } + inline typename DimensionTraits::VectorType size() const { return _size; } /** @brief Pointer to raw data */ inline void* data() { return _data; } @@ -78,10 +78,10 @@ template class Image: public AbstractImage { * Deletes previous data and replaces them with new. Note that the * data are not copied, but they are deleted on destruction. */ - void setData(const typename DimensionTraits::VectorType& size, Format format, Type type, GLvoid* data); + void setData(const typename DimensionTraits::VectorType& size, Format format, Type type, GLvoid* data); private: - Math::Vector _size; + Math::Vector _size; char* _data; }; diff --git a/src/ImageWrapper.h b/src/ImageWrapper.h index c3a5046b5..739bb810a 100644 --- a/src/ImageWrapper.h +++ b/src/ImageWrapper.h @@ -40,9 +40,9 @@ to change image properties, only data pointer. Interchangeable with Image, BufferImage or Trade::ImageData. @see ImageWrapper1D, ImageWrapper2D, ImageWrapper3D */ -template class ImageWrapper: public AbstractImage { +template class ImageWrapper: public AbstractImage { public: - const static std::uint8_t Dimensions = dimensions; /**< @brief %Image dimension count */ + const static UnsignedInt Dimensions = dimensions; /**< @brief %Image dimension count */ /** * @brief Constructor * @param size %Image size @@ -53,7 +53,7 @@ template class ImageWrapper: public AbstractImage { * Note that the image data are not copied on construction, but they * are deleted on class destruction. */ - inline explicit ImageWrapper(const typename DimensionTraits::VectorType& size, Format format, Type type, GLvoid* data): AbstractImage(format, type), _size(size), _data(reinterpret_cast(data)) {} + inline explicit ImageWrapper(const typename DimensionTraits::VectorType& size, Format format, Type type, GLvoid* data): AbstractImage(format, type), _size(size), _data(reinterpret_cast(data)) {} /** * @brief Constructor @@ -64,10 +64,10 @@ template class ImageWrapper: public AbstractImage { * Dimensions and data pointer are set to zero, call setData() to fill * the image with data. */ - inline explicit ImageWrapper(const typename DimensionTraits::VectorType& size, Format format, Type type): AbstractImage(format, type), _size(size), _data(nullptr) {} + inline explicit ImageWrapper(const typename DimensionTraits::VectorType& size, Format format, Type type): AbstractImage(format, type), _size(size), _data(nullptr) {} /** @brief %Image size */ - inline typename DimensionTraits::VectorType size() const { return _size; } + inline typename DimensionTraits::VectorType size() const { return _size; } /** @brief Pointer to raw data */ inline void* data() { return _data; } @@ -86,7 +86,7 @@ template class ImageWrapper: public AbstractImage { } private: - Math::Vector _size; + Math::Vector _size; char* _data; }; diff --git a/src/Magnum.h b/src/Magnum.h index 862b2b14d..782d97a0c 100644 --- a/src/Magnum.h +++ b/src/Magnum.h @@ -267,7 +267,7 @@ class AbstractImage; class AbstractShaderProgram; class AbstractTexture; -template class Array; +template class Array; template class Array1D; template class Array2D; template class Array3D; @@ -275,7 +275,7 @@ template class Array3D; class Buffer; #ifndef MAGNUM_TARGET_GLES2 -template class BufferImage; +template class BufferImage; typedef BufferImage<1> BufferImage1D; typedef BufferImage<2> BufferImage2D; typedef BufferImage<3> BufferImage3D; @@ -285,10 +285,10 @@ typedef BufferImage<3> BufferImage3D; class BufferTexture; #endif -template class Color3; -template class Color4; +template class Color3; +template class Color4; -enum class Version: GLint; +enum class Version: Int; class Context; class CubeMapTexture; @@ -303,12 +303,12 @@ class CubeMapTextureArray; class Extension; class Framebuffer; -template class Image; +template class Image; typedef Image<1> Image1D; typedef Image<2> Image2D; typedef Image<3> Image3D; -template class ImageWrapper; +template class ImageWrapper; typedef ImageWrapper<1> ImageWrapper1D; typedef ImageWrapper<2> ImageWrapper2D; typedef ImageWrapper<3> ImageWrapper3D; @@ -317,16 +317,16 @@ class Mesh; class Query; class Renderbuffer; -enum class ResourceState: std::uint8_t; -enum class ResourceDataState: std::uint8_t; -enum class ResourcePolicy: std::uint8_t; +enum class ResourceState: UnsignedByte; +enum class ResourceDataState: UnsignedByte; +enum class ResourcePolicy: UnsignedByte; template class Resource; class ResourceKey; template class ResourceManager; class Shader; -template class Texture; +template class Texture; #ifndef MAGNUM_TARGET_GLES typedef Texture<1> Texture1D; #endif diff --git a/src/Mesh.cpp b/src/Mesh.cpp index f78cd89de..566f3dee2 100644 --- a/src/Mesh.cpp +++ b/src/Mesh.cpp @@ -108,7 +108,7 @@ Mesh& Mesh::operator=(Mesh&& other) { return *this; } -Mesh* Mesh::setIndexBuffer(Buffer* buffer, GLintptr offset, IndexType type, GLuint start, GLuint end) { +Mesh* Mesh::setIndexBuffer(Buffer* buffer, GLintptr offset, IndexType type, UnsignedInt start, UnsignedInt end) { indexOffset = offset; indexType = type; #ifndef MAGNUM_TARGET_GLES2 diff --git a/src/Mesh.h b/src/Mesh.h index 3f2c554f2..4b0641879 100644 --- a/src/Mesh.h +++ b/src/Mesh.h @@ -381,7 +381,7 @@ class MAGNUM_EXPORT Mesh { * polygon offset for desired polygon modes. * @see @fn_gl{PolygonOffset} */ - inline static void setPolygonOffset(GLfloat factor, GLfloat units) { + inline static void setPolygonOffset(Float factor, Float units) { glPolygonOffset(factor, units); } @@ -391,7 +391,7 @@ class MAGNUM_EXPORT Mesh { * Initial value is `1.0f`. * @see @fn_gl{LineWidth} */ - inline static void setLineWidth(GLfloat width) { + inline static void setLineWidth(Float width) { glLineWidth(width); } @@ -404,7 +404,7 @@ class MAGNUM_EXPORT Mesh { * @requires_gl Set directly in vertex shader using @c gl_PointSize * builtin variable. */ - inline static void setPointSize(GLfloat size) { + inline static void setPointSize(Float size) { glPointSize(size); } @@ -528,7 +528,7 @@ class MAGNUM_EXPORT Mesh { } /** @brief Vertex count */ - inline GLsizei vertexCount() const { return _vertexCount; } + inline Int vertexCount() const { return _vertexCount; } /** * @brief Set vertex count @@ -538,13 +538,13 @@ class MAGNUM_EXPORT Mesh { * @see setPrimitive(), addVertexBuffer(), addInterleavedVertexBuffer(), * addVertexBufferStride(), MeshTools::interleave() */ - inline Mesh* setVertexCount(GLsizei vertexCount) { + inline Mesh* setVertexCount(Int vertexCount) { _vertexCount = vertexCount; return this; } /** @brief Index count */ - inline GLsizei indexCount() const { return _indexCount; } + inline Int indexCount() const { return _indexCount; } /** * @brief Set index count @@ -553,7 +553,7 @@ class MAGNUM_EXPORT Mesh { * Default is zero. * @see setIndexBuffer(), MeshTools::compressIndices() */ - inline Mesh* setIndexCount(GLsizei count) { + inline Mesh* setIndexCount(Int count) { _indexCount = count; return this; } @@ -637,7 +637,7 @@ class MAGNUM_EXPORT Mesh { * Buffer* buffer; * mesh->addInterleavedVertexBuffer(buffer, * 35, // skip other data - * sizeof(GLfloat), // skip vertex weight + * sizeof(Float), // skip vertex weight * Shaders::PhongShader::Position(), // vertex position * sizeof(Vector2), // skip texture coordinates * Shaders::PhongShader::Normal()); // vertex normal @@ -648,14 +648,14 @@ class MAGNUM_EXPORT Mesh { * between vertex attributes: * @code * GLsizei stride = // size of one vertex - * sizeof(GLfloat) + + * sizeof(Float) + * sizeof(Shaders::PhongShader::Position::Type) + * sizeof(Vector2) + * sizeof(Shaders::PhongShader::Normal::Type); * - * mesh->addVertexBufferStride(buffer, 35 + sizeof(GLfloat), + * mesh->addVertexBufferStride(buffer, 35 + sizeof(Float), * stride, Shaders::PhongShader::Position()); - * ->addVertexBufferStride(buffer, 35 + sizeof(GLfloat) + + * ->addVertexBufferStride(buffer, 35 + sizeof(Float) + * sizeof(Shaders::PhongShader::Position::Type) + sizeof(Vector2), * stride, Shaders::PhongShader::Normal()); * @endcode @@ -683,7 +683,7 @@ class MAGNUM_EXPORT Mesh { * * See addInterleavedVertexBuffer() for more information. */ - template inline Mesh* addVertexBufferStride(Buffer* buffer, GLintptr offset, GLsizei stride, const AbstractShaderProgram::Attribute& attribute) { + template inline Mesh* addVertexBufferStride(Buffer* buffer, GLintptr offset, GLsizei stride, const AbstractShaderProgram::Attribute& attribute) { addInterleavedVertexBufferInternal(buffer, offset, stride, attribute); return this; } @@ -708,7 +708,7 @@ class MAGNUM_EXPORT Mesh { * @fn_gl{BindVertexArray}, @fn_gl{BindBuffer} (if * @extension{APPLE,vertex_array_object} is available) */ - Mesh* setIndexBuffer(Buffer* buffer, GLintptr offset, IndexType type, GLuint start, GLuint end); + Mesh* setIndexBuffer(Buffer* buffer, GLintptr offset, IndexType type, UnsignedInt start, UnsignedInt end); /** * @brief Set index buffer @@ -717,7 +717,7 @@ class MAGNUM_EXPORT Mesh { * @param type Index data type * @return Pointer to self (for method chaining) * - * Prefer to use setIndexBuffer(Buffer*, GLintptr, IndexType, GLuint, GLuint) + * Prefer to use setIndexBuffer(Buffer*, GLintptr, IndexType, UnsignedInt, UnsignedInt) * for better performance. * @see setIndexCount(), MeshTools::compressIndices(), * @fn_gl{BindVertexArray}, @fn_gl{BindBuffer} (if @@ -778,7 +778,7 @@ class MAGNUM_EXPORT Mesh { static void MAGNUM_LOCAL initializeContextBasedFunctionality(Context* context); /* Adding non-interleaved vertex attributes */ - template inline void addVertexBufferInternal(Buffer* buffer, GLintptr offset, const AbstractShaderProgram::Attribute& attribute, const U&... attributes) { + template inline void addVertexBufferInternal(Buffer* buffer, GLintptr offset, const AbstractShaderProgram::Attribute& attribute, const U&... attributes) { addVertexAttribute(buffer, attribute, offset, 0); /* Add size of this attribute array to offset for next attribute */ @@ -791,7 +791,7 @@ class MAGNUM_EXPORT Mesh { inline void addVertexBufferInternal(Buffer*, GLintptr) {} /* Computing stride of interleaved vertex attributes */ - template inline static GLsizei strideOfInterleaved(const AbstractShaderProgram::Attribute& attribute, const U&... attributes) { + template inline static GLsizei strideOfInterleaved(const AbstractShaderProgram::Attribute& attribute, const U&... attributes) { return attribute.dataSize() + strideOfInterleaved(attributes...); } template inline static GLsizei strideOfInterleaved(GLintptr gap, const T&... attributes) { @@ -800,7 +800,7 @@ class MAGNUM_EXPORT Mesh { inline static GLsizei strideOfInterleaved() { return 0; } /* Adding interleaved vertex attributes */ - template inline void addInterleavedVertexBufferInternal(Buffer* buffer, GLintptr offset, GLsizei stride, const AbstractShaderProgram::Attribute& attribute, const U&... attributes) { + template inline void addInterleavedVertexBufferInternal(Buffer* buffer, GLintptr offset, GLsizei stride, const AbstractShaderProgram::Attribute& attribute, const U&... attributes) { addVertexAttribute(buffer, attribute, offset, stride); /* Add size of this attribute to offset for next attribute */ @@ -812,8 +812,8 @@ class MAGNUM_EXPORT Mesh { } inline void addInterleavedVertexBufferInternal(Buffer*, GLsizei, GLintptr) {} - template inline void addVertexAttribute(typename std::enable_if::Type, GLfloat>::value, Buffer*>::type buffer, const AbstractShaderProgram::Attribute& attribute, GLintptr offset, GLsizei stride) { - for(GLuint i = 0; i != Implementation::Attribute::vectorCount(); ++i) + template inline void addVertexAttribute(typename std::enable_if::Type, Float>::value, Buffer*>::type buffer, const AbstractShaderProgram::Attribute& attribute, GLintptr offset, GLsizei stride) { + for(UnsignedInt i = 0; i != Implementation::Attribute::vectorCount(); ++i) (this->*attributePointerImplementation)(Attribute{ buffer, location+i, @@ -826,7 +826,7 @@ class MAGNUM_EXPORT Mesh { } #ifndef MAGNUM_TARGET_GLES2 - template inline void addVertexAttribute(typename std::enable_if::Type>::value, Buffer*>::type buffer, const AbstractShaderProgram::Attribute& attribute, GLintptr offset, GLsizei stride) { + template inline void addVertexAttribute(typename std::enable_if::Type>::value, Buffer*>::type buffer, const AbstractShaderProgram::Attribute& attribute, GLintptr offset, GLsizei stride) { (this->*attributeIPointerImplementation)(IntegerAttribute{ buffer, location, @@ -838,8 +838,8 @@ class MAGNUM_EXPORT Mesh { } #ifndef MAGNUM_TARGET_GLES - template inline void addVertexAttribute(typename std::enable_if::Type, GLdouble>::value, Buffer*>::type buffer, const AbstractShaderProgram::Attribute& attribute, GLintptr offset, GLsizei stride) { - for(GLuint i = 0; i != Implementation::Attribute::vectorCount(); ++i) + template inline void addVertexAttribute(typename std::enable_if::Type, Double>::value, Buffer*>::type buffer, const AbstractShaderProgram::Attribute& attribute, GLintptr offset, GLsizei stride) { + for(UnsignedInt i = 0; i != Implementation::Attribute::vectorCount(); ++i) (this->*attributeLPointerImplementation)(LongAttribute{ buffer, location+i, @@ -915,9 +915,9 @@ class MAGNUM_EXPORT Mesh { GLuint vao; Primitive _primitive; - GLsizei _vertexCount, _indexCount; + Int _vertexCount, _indexCount; #ifndef MAGNUM_TARGET_GLES2 - GLuint indexStart, indexEnd; + UnsignedInt indexStart, indexEnd; #endif GLintptr indexOffset; IndexType indexType; diff --git a/src/Query.cpp b/src/Query.cpp index 1b9fc86bc..12cf4e527 100644 --- a/src/Query.cpp +++ b/src/Query.cpp @@ -39,10 +39,10 @@ template<> bool AbstractQuery::result() { #endif } -template<> GLuint AbstractQuery::result() { +template<> UnsignedInt AbstractQuery::result() { /** @todo Re-enable when extension wrangler is available for ES */ #ifndef MAGNUM_TARGET_GLES2 - GLuint result; + UnsignedInt result; glGetQueryObjectuiv(_id, GL_QUERY_RESULT, &result); return result; #else @@ -51,20 +51,20 @@ template<> GLuint AbstractQuery::result() { } #ifndef MAGNUM_TARGET_GLES -template<> GLint AbstractQuery::result() { - GLint result; +template<> Int AbstractQuery::result() { + Int result; glGetQueryObjectiv(_id, GL_QUERY_RESULT, &result); return result; } -template<> GLuint64 AbstractQuery::result() { - GLuint64 result; +template<> UnsignedLong AbstractQuery::result() { + UnsignedLong result; glGetQueryObjectui64v(_id, GL_QUERY_RESULT, &result); return result; } -template<> GLint64 AbstractQuery::result() { - GLint64 result; +template<> Long AbstractQuery::result() { + Long result; glGetQueryObjecti64v(_id, GL_QUERY_RESULT, &result); return result; } diff --git a/src/Query.h b/src/Query.h index f768c8ca7..22aace60f 100644 --- a/src/Query.h +++ b/src/Query.h @@ -72,16 +72,16 @@ class MAGNUM_EXPORT AbstractQuery { /** * @brief Result - * @tparam T Result type. Can be either `bool`, `GLuint`, - * `GLint`, `GLuint64` or `GLint64`. + * @tparam T Result type. Can be either `bool`, @ref UnsignedInt, + * @ref Int, @ref UnsignedLong or @ref Long. * * Note that this function is blocking until the result is available. * See resultAvailable(). * @see @fn_gl{GetQueryObject} with @def_gl{QUERY_RESULT} - * @requires_gl33 %Extension @extension{ARB,timer_query} (result - * type `GLuint64` and `GLint64`) - * @requires_gl Result types @c GLint, @c GLuint64 and @c GLint64 are - * not available in OpenGL ES. + * @requires_gl33 %Extension @extension{ARB,timer_query} (result type + * UnsignedInt and Long) + * @requires_gl Result types Int, UnsignedLong and Long are not + * available in OpenGL ES. */ template T result(); @@ -92,11 +92,11 @@ class MAGNUM_EXPORT AbstractQuery { #ifndef DOXYGEN_GENERATING_OUTPUT template<> bool MAGNUM_EXPORT AbstractQuery::result(); -template<> GLuint MAGNUM_EXPORT AbstractQuery::result(); +template<> UnsignedInt MAGNUM_EXPORT AbstractQuery::result(); #ifndef MAGNUM_TARGET_GLES -template<> GLint MAGNUM_EXPORT AbstractQuery::result(); -template<> GLuint64 MAGNUM_EXPORT AbstractQuery::result(); -template<> GLint64 MAGNUM_EXPORT AbstractQuery::result(); +template<> Int MAGNUM_EXPORT AbstractQuery::result(); +template<> UnsignedLong MAGNUM_EXPORT AbstractQuery::result(); +template<> Long MAGNUM_EXPORT AbstractQuery::result(); #endif #endif @@ -118,7 +118,7 @@ if(!q.resultAvailable()) { } // ...or block until the result is available -GLuint primitiveCount = q.result(); +UnsignedInt primitiveCount = q.result(); @endcode @requires_gl30 %Extension @extension{EXT,transform_feedback} @requires_gles30 Only sample queries are available on OpenGL ES 2.0. @@ -338,8 +338,8 @@ q1.end(); q2.begin(Query::Target::TimeElapsed); // another rendering... q2.end(); -GLuint timeElapsed1 = q1.result(); -GLuint timeElapsed2 = q2.result(); +UnsignedInt timeElapsed1 = q1.result(); +UnsignedInt timeElapsed2 = q2.result(); @endcode @code TimeQuery q1, q2, q3; @@ -348,9 +348,9 @@ q1.timestamp(); q2.timestamp(); // another rendering... q3.timestamp(); -GLuint tmp = q2.result(); -GLuint timeElapsed1 = tmp-q1.result(); -GLuint timeElapsed2 = q3.result()-tmp; +UnsignedInt tmp = q2.result(); +UnsignedInt timeElapsed1 = tmp-q1.result(); +UnsignedInt timeElapsed2 = q3.result()-tmp; @endcode Using this query results in fewer OpenGL calls when doing more measures. @requires_gl33 %Extension @extension{ARB,timer_query} diff --git a/src/Renderer.h b/src/Renderer.h index e2274fc61..f91144556 100644 --- a/src/Renderer.h +++ b/src/Renderer.h @@ -43,9 +43,9 @@ class MAGNUM_EXPORT Renderer { * @brief Affected polygon facing for culling, stencil operations and masks * * @see setFaceCullingMode(), - * setStencilFunction(PolygonFacing, StencilFunction, GLint, GLuint), + * setStencilFunction(PolygonFacing, StencilFunction, Int, UnsignedInt), * setStencilOperation(PolygonFacing, StencilOperation, StencilOperation, StencilOperation), - * setStencilMask(PolygonFacing, GLuint) + * setStencilMask(PolygonFacing, UnsignedInt) */ enum class PolygonFacing: GLenum { Front = GL_FRONT, /**< Front-facing polygons */ @@ -137,9 +137,9 @@ class MAGNUM_EXPORT Renderer { * * Initial value is `1.0`. * @see @fn_gl{ClearDepth} - * @requires_gl See setClearDepth(GLfloat), which is available in OpenGL ES. + * @requires_gl See setClearDepth(Float), which is available in OpenGL ES. */ - inline static void setClearDepth(GLdouble depth) { glClearDepth(depth); } + inline static void setClearDepth(Double depth) { glClearDepth(depth); } #endif /** @@ -149,7 +149,7 @@ class MAGNUM_EXPORT Renderer { * @requires_gl41 %Extension @extension{ARB,ES2_compatibility} * @todo Call double version if the extension is not available */ - inline static void setClearDepth(GLfloat depth) { glClearDepthf(depth); } + inline static void setClearDepth(Float depth) { glClearDepthf(depth); } /** * @brief Set clear stencil @@ -157,7 +157,7 @@ class MAGNUM_EXPORT Renderer { * Initial value is `0`. * @see @fn_gl{ClearStencil} */ - inline static void setClearStencil(GLint stencil) { glClearStencil(stencil); } + inline static void setClearStencil(Int stencil) { glClearStencil(stencil); } /*@}*/ @@ -252,21 +252,21 @@ class MAGNUM_EXPORT Renderer { * Initial value is all `1`s. * * @attention You have to enable stencil test with setFeature() first. - * @see setStencilFunction(StencilFunction, GLint, GLuint), + * @see setStencilFunction(StencilFunction, Int, UnsignedInt), * @fn_gl{StencilFuncSeparate} */ - inline static void setStencilFunction(PolygonFacing facing, StencilFunction function, GLint referenceValue, GLuint mask) { + inline static void setStencilFunction(PolygonFacing facing, StencilFunction function, Int referenceValue, UnsignedInt mask) { glStencilFuncSeparate(static_cast(facing), static_cast(function), referenceValue, mask); } /** * @brief Set stencil function * - * The same as setStencilFunction(PolygonFacing, StencilFunction, GLint, GLuint) + * The same as setStencilFunction(PolygonFacing, StencilFunction, Int, UnsignedInt) * with `facing` set to `PolygonFacing::FrontAndBack`. * @see @fn_gl{StencilFunc} */ - inline static void setStencilFunction(StencilFunction function, GLint referenceValue, GLuint mask) { + inline static void setStencilFunction(StencilFunction function, Int referenceValue, UnsignedInt mask) { glStencilFunc(static_cast(function), referenceValue, mask); } @@ -353,20 +353,20 @@ class MAGNUM_EXPORT Renderer { * * Set given bit to `0` to disallow writing stencil value for given * faces to it. Initial value is all `1`s. - * @see setStencilMask(GLuint), @fn_gl{StencilMaskSeparate} + * @see setStencilMask(UnsignedInt), @fn_gl{StencilMaskSeparate} */ - inline static void setStencilMask(PolygonFacing facing, GLuint allowBits) { + inline static void setStencilMask(PolygonFacing facing, UnsignedInt allowBits) { glStencilMaskSeparate(static_cast(facing), allowBits); } /** * @brief Mask stencil writes * - * The same as setStencilMask(PolygonFacing, GLuint) with `facing` set + * The same as setStencilMask(PolygonFacing, UnsignedInt) with `facing` set * to `PolygonFacing::FrontAndBack`. * @see @fn_gl{StencilMask} */ - inline static void setStencilMask(GLuint allowBits) { + inline static void setStencilMask(UnsignedInt allowBits) { glStencilMask(allowBits); } diff --git a/src/Resource.h b/src/Resource.h index 88dbb415b..71e00d856 100644 --- a/src/Resource.h +++ b/src/Resource.h @@ -33,7 +33,7 @@ namespace Magnum { * * @see Resource::state(), ResourceManager::state() */ -enum class ResourceState: std::uint8_t { +enum class ResourceState: UnsignedByte { /** The resource is not yet loaded (and no fallback is available). */ NotLoaded, diff --git a/src/ResourceManager.h b/src/ResourceManager.h index 1c0128e85..2ae2d5075 100644 --- a/src/ResourceManager.h +++ b/src/ResourceManager.h @@ -30,18 +30,18 @@ namespace Magnum { * * @see ResourceManager::set(), ResourceState */ -enum class ResourceDataState: std::uint8_t { +enum class ResourceDataState: UnsignedByte { /** * The resource is currently loading. Parameter @p data in ResourceManager::set() * should be set to `null`. */ - Loading = int(ResourceState::Loading), + Loading = UnsignedByte(ResourceState::Loading), /** * The resource was not found. Parameter @p data in ResourceManager::set() * should be set to `null`. */ - NotFound = int(ResourceState::NotFound), + NotFound = UnsignedByte(ResourceState::NotFound), /** * The resource can be changed by the manager in the future. This is @@ -49,14 +49,14 @@ enum class ResourceDataState: std::uint8_t { * the data are accessed, but allows changing the data for e.g. debugging * purposes. */ - Mutable = std::uint8_t(ResourceState::Mutable), + Mutable = UnsignedByte(ResourceState::Mutable), /** * The resource cannot be changed by the manager in the future. This is * faster, as Resource instances will ask for the data only one time, thus * suitable for production code. */ - Final = std::uint8_t(ResourceState::Final) + Final = UnsignedByte(ResourceState::Final) }; /** @relates ResourceManager @@ -64,7 +64,7 @@ enum class ResourceDataState: std::uint8_t { @see ResourceManager::set(), ResourceManager::free() */ -enum class ResourcePolicy: std::uint8_t { +enum class ResourcePolicy: UnsignedByte { /** The resource will stay resident for whole lifetime of resource manager. */ Resident, diff --git a/src/Test/AbstractShaderProgramTest.cpp b/src/Test/AbstractShaderProgramTest.cpp index 7a3de5032..1f8738b55 100644 --- a/src/Test/AbstractShaderProgramTest.cpp +++ b/src/Test/AbstractShaderProgramTest.cpp @@ -57,7 +57,7 @@ AbstractShaderProgramTest::AbstractShaderProgramTest() { } void AbstractShaderProgramTest::attributeScalar() { - typedef AbstractShaderProgram::Attribute<3, GLfloat> Attribute; + typedef AbstractShaderProgram::Attribute<3, Float> Attribute; CORRADE_COMPARE(Attribute::Location, 3); /* Default constructor */ @@ -74,7 +74,7 @@ void AbstractShaderProgramTest::attributeScalar() { } void AbstractShaderProgramTest::attributeScalarInt() { - typedef AbstractShaderProgram::Attribute<3, GLint> Attribute; + typedef AbstractShaderProgram::Attribute<3, Int> Attribute; /* Default constructor */ Attribute a; @@ -86,7 +86,7 @@ void AbstractShaderProgramTest::attributeScalarInt() { } void AbstractShaderProgramTest::attributeScalarUnsignedInt() { - typedef AbstractShaderProgram::Attribute<3, GLuint> Attribute; + typedef AbstractShaderProgram::Attribute<3, UnsignedInt> Attribute; /* Default constructor */ Attribute a; @@ -99,7 +99,7 @@ void AbstractShaderProgramTest::attributeScalarUnsignedInt() { void AbstractShaderProgramTest::attributeScalarDouble() { #ifndef MAGNUM_TARGET_GLES - typedef AbstractShaderProgram::Attribute<3, GLdouble> Attribute; + typedef AbstractShaderProgram::Attribute<3, Double> Attribute; /* Default constructor */ Attribute a; diff --git a/src/Test/ColorTest.cpp b/src/Test/ColorTest.cpp index b7af66ad9..d171637d4 100644 --- a/src/Test/ColorTest.cpp +++ b/src/Test/ColorTest.cpp @@ -43,10 +43,10 @@ class ColorTest: public Corrade::TestSuite::Tester { void configuration(); }; -typedef Magnum::Color3 Color3; -typedef Magnum::Color4 Color4; -typedef Magnum::Color3 Color3f; -typedef Magnum::Color4 Color4f; +typedef Magnum::Color3 Color3; +typedef Magnum::Color4 Color4; +typedef Magnum::Color3 Color3f; +typedef Magnum::Color4 Color4f; ColorTest::ColorTest() { addTests(&ColorTest::access, @@ -130,7 +130,7 @@ void ColorTest::hsv() { CORRADE_COMPARE(Color3::fromHSV(Deg(230.0f), 0.749f, 0.427f), Color3(27, 40, 108)); Deg hue; - float saturation, value; + Float saturation, value; std::tie(hue, saturation, value) = Color3(27, 41, 109).toHSV(); CORRADE_COMPARE(hue, Deg(229.756106f)); CORRADE_COMPARE(saturation, 0.752294f); diff --git a/src/Test/ResourceManagerTest.cpp b/src/Test/ResourceManagerTest.cpp index 6028555d8..18f4ed22f 100644 --- a/src/Test/ResourceManagerTest.cpp +++ b/src/Test/ResourceManagerTest.cpp @@ -45,16 +45,16 @@ class Data { inline ~Data() { --count; } }; -typedef Magnum::ResourceManager ResourceManager; +typedef Magnum::ResourceManager ResourceManager; -class IntResourceLoader: public AbstractResourceLoader { +class IntResourceLoader: public AbstractResourceLoader { public: void load(ResourceKey key) override { AbstractResourceLoader::load(key); } void load() { - set("hello", new std::int32_t(773), ResourceDataState::Final, ResourcePolicy::Resident); + set("hello", new Int(773), ResourceDataState::Final, ResourcePolicy::Resident); setNotFound("world"); } }; @@ -143,27 +143,27 @@ void ResourceManagerTest::basic() { /* One mutable, one final */ ResourceKey questionKey("the-question"); ResourceKey answerKey("the-answer"); - rm.set(questionKey, new std::int32_t(10), ResourceDataState::Mutable, ResourcePolicy::Resident); - rm.set(answerKey, new std::int32_t(42), ResourceDataState::Final, ResourcePolicy::Resident); - Resource theQuestion = rm.get(questionKey); - Resource theAnswer = rm.get(answerKey); + rm.set(questionKey, new Int(10), ResourceDataState::Mutable, ResourcePolicy::Resident); + rm.set(answerKey, new Int(42), ResourceDataState::Final, ResourcePolicy::Resident); + Resource theQuestion = rm.get(questionKey); + Resource theAnswer = rm.get(answerKey); /* Check basic functionality */ CORRADE_COMPARE(theQuestion.state(), ResourceState::Mutable); CORRADE_COMPARE(theAnswer.state(), ResourceState::Final); CORRADE_COMPARE(*theQuestion, 10); CORRADE_COMPARE(*theAnswer, 42); - CORRADE_COMPARE(rm.count(), 2); + CORRADE_COMPARE(rm.count(), 2); /* Cannot change already final resource */ std::ostringstream out; Error::setOutput(&out); - rm.set(answerKey, new std::int32_t(43), ResourceDataState::Mutable, ResourcePolicy::Resident); + rm.set(answerKey, new Int(43), ResourceDataState::Mutable, ResourcePolicy::Resident); CORRADE_COMPARE(*theAnswer, 42); CORRADE_COMPARE(out.str(), "ResourceManager::set(): cannot change already final resource " + answerKey.hexString() + '\n'); /* But non-final can be changed */ - rm.set(questionKey, new std::int32_t(20), ResourceDataState::Final, ResourcePolicy::Resident); + rm.set(questionKey, new Int(20), ResourceDataState::Final, ResourcePolicy::Resident); CORRADE_COMPARE(theQuestion.state(), ResourceState::Final); CORRADE_COMPARE(*theQuestion, 20); } @@ -235,8 +235,8 @@ void ResourceManagerTest::loader() { rm.setLoader(&loader); Resource data = rm.get("data"); - Resource hello = rm.get("hello"); - Resource world = rm.get("world"); + Resource hello = rm.get("hello"); + Resource world = rm.get("world"); CORRADE_COMPARE(data.state(), ResourceState::NotLoaded); CORRADE_COMPARE(hello.state(), ResourceState::Loading); CORRADE_COMPARE(world.state(), ResourceState::Loading); diff --git a/src/Test/SwizzleTest.cpp b/src/Test/SwizzleTest.cpp index d3f500333..5a50565a4 100644 --- a/src/Test/SwizzleTest.cpp +++ b/src/Test/SwizzleTest.cpp @@ -44,18 +44,18 @@ void SwizzleTest::type() { CORRADE_VERIFY((std::is_same(orig)), Vector3i>::value)); CORRADE_VERIFY((std::is_same(orig)), Vector4i>::value)); - Color3 origColor3; - Color4 origColor4; - CORRADE_VERIFY((std::is_same(origColor3)), Color3<>>::value)); - CORRADE_VERIFY((std::is_same(origColor4)), Color3>::value)); - CORRADE_VERIFY((std::is_same(origColor3)), Color4<>>::value)); - CORRADE_VERIFY((std::is_same(origColor4)), Color4>::value)); + Color3 origColor3; + Color4 origColor4; + CORRADE_VERIFY((std::is_same(origColor3)), Color3>::value)); + CORRADE_VERIFY((std::is_same(origColor4)), Color3>::value)); + CORRADE_VERIFY((std::is_same(origColor3)), Color4>::value)); + CORRADE_VERIFY((std::is_same(origColor4)), Color4>::value)); } void SwizzleTest::defaultType() { Vector4i orig(1, 2, 3, 4); - CORRADE_COMPARE(swizzle<'b'>(orig), (Math::Vector<1, std::int32_t>(3))); - CORRADE_COMPARE((swizzle<'b', 'r', 'a', 'g', 'z', 'y', 'x'>(orig)), (Math::Vector<7, std::int32_t>(3, 1, 4, 2, 3, 2, 1))); + CORRADE_COMPARE(swizzle<'b'>(orig), (Math::Vector<1, Int>(3))); + CORRADE_COMPARE((swizzle<'b', 'r', 'a', 'g', 'z', 'y', 'x'>(orig)), (Math::Vector<7, Int>(3, 1, 4, 2, 3, 2, 1))); } }} diff --git a/src/Texture.h b/src/Texture.h index 80cf12063..6e946227c 100644 --- a/src/Texture.h +++ b/src/Texture.h @@ -107,9 +107,9 @@ generateMipmap() documentation for more information. @see Texture1D, Texture2D, Texture3D, CubeMapTexture, CubeMapTextureArray @todo @extension{AMD,sparse_texture} */ -template class Texture: public AbstractTexture { +template class Texture: public AbstractTexture { public: - static const std::uint8_t Dimensions = dimensions; /**< @brief %Texture dimension count */ + static const UnsignedInt Dimensions = dimensions; /**< @brief %Texture dimension count */ #ifdef DOXYGEN_GENERATING_OUTPUT /** @@ -186,7 +186,7 @@ template class Texture: public AbstractTexture { * with @def_gl{TEXTURE_WIDTH}, @def_gl{TEXTURE_HEIGHT} or @def_gl{TEXTURE_DEPTH}. * @requires_gl %Texture image queries are not available in OpenGL ES. */ - inline typename DimensionTraits::VectorType imageSize(GLint level) { + inline typename DimensionTraits::VectorType imageSize(Int level) { return DataHelper::imageSize(this, _target, level); } #endif @@ -236,7 +236,7 @@ template class Texture: public AbstractTexture { * @requires_gl42 %Extension @extension{ARB,texture_storage} * @requires_gles30 %Extension @es_extension{EXT,texture_storage} */ - inline Texture* setStorage(GLsizei levels, InternalFormat internalFormat, const typename DimensionTraits::VectorType& size) { + inline Texture* setStorage(Int levels, InternalFormat internalFormat, const typename DimensionTraits::VectorType& size) { DataHelper::setStorage(this, _target, levels, internalFormat, size); return this; } @@ -263,7 +263,7 @@ template class Texture: public AbstractTexture { * @fn_gl_extension{TextureImage2D,EXT,direct_state_access}/ * @fn_gl_extension{TextureImage3D,EXT,direct_state_access} */ - template inline Texture* setImage(GLint level, InternalFormat internalFormat, Image* image) { + template inline Texture* setImage(Int level, InternalFormat internalFormat, Image* image) { DataHelper::set(this, _target, level, internalFormat, image); return this; } @@ -293,7 +293,7 @@ template class Texture: public AbstractTexture { * @fn_gl_extension{TextureSubImage2D,EXT,direct_state_access}/ * @fn_gl_extension{TextureSubImage3D,EXT,direct_state_access} */ - template inline Texture* setSubImage(GLint level, const typename DimensionTraits::VectorType& offset, Image* image) { + template inline Texture* setSubImage(Int level, const typename DimensionTraits::VectorType& offset, Image* image) { DataHelper::setSub(this, _target, level, offset, image); return this; } @@ -308,7 +308,7 @@ template class Texture: public AbstractTexture { * is not available, this function does nothing. * @see invalidateImage(), @fn_gl{InvalidateTexSubImage} */ - inline void invalidateSubImage(GLint level, const typename DimensionTraits::VectorType& offset, const typename DimensionTraits::VectorType& size) { + inline void invalidateSubImage(Int level, const typename DimensionTraits::VectorType& offset, const typename DimensionTraits::VectorType& size) { DataHelper::invalidateSub(this, level, offset, size); } @@ -327,7 +327,7 @@ template class Texture: public AbstractTexture { AbstractTexture::setBorderColor(color); return this; } - inline Texture* setMaxAnisotropy(GLfloat anisotropy) { + inline Texture* setMaxAnisotropy(Float anisotropy) { AbstractTexture::setMaxAnisotropy(anisotropy); return this; } diff --git a/src/Timeline.cpp b/src/Timeline.cpp index 3a4419464..a94d19376 100644 --- a/src/Timeline.cpp +++ b/src/Timeline.cpp @@ -39,7 +39,7 @@ void Timeline::nextFrame() { if(!running) return; auto now = high_resolution_clock::now(); - std::uint32_t duration = duration_cast(now-_previousFrameTime).count(); + UnsignedInt duration = duration_cast(now-_previousFrameTime).count(); _previousFrameDuration = duration/1e6f; if(_previousFrameDuration < _minimalFrameTime) { @@ -51,7 +51,7 @@ void Timeline::nextFrame() { _previousFrameTime = now; } -GLfloat Timeline::previousFrameTime() const { +Float Timeline::previousFrameTime() const { return duration_cast(_previousFrameTime-_startTime).count()/1e6f; } diff --git a/src/Timeline.h b/src/Timeline.h index 581f2ba2b..91908937e 100644 --- a/src/Timeline.h +++ b/src/Timeline.h @@ -60,7 +60,7 @@ MyApplication::MyApplication(...): Platform::GlutApplication(...) { void MyApplication::drawEvent() { // Distance of object travelling at speed of 15 units per second - GLfloat distance = 15.0f*timeline.previousFrameDuration(); + Float distance = 15.0f*timeline.previousFrameDuration(); // Move object, draw ... @@ -81,7 +81,7 @@ class MAGNUM_EXPORT Timeline { inline constexpr explicit Timeline(): _minimalFrameTime(0), _previousFrameDuration(0), running(false) {} /** @brief Minimal frame time (in seconds) */ - inline constexpr GLfloat minimalFrameTime() const { + inline constexpr Float minimalFrameTime() const { return _minimalFrameTime; } @@ -91,7 +91,7 @@ class MAGNUM_EXPORT Timeline { * Default value is 0. * @see nextFrame() */ - inline void setMinimalFrameTime(GLfloat seconds) { + inline void setMinimalFrameTime(Float seconds) { _minimalFrameTime = seconds; } @@ -126,22 +126,22 @@ class MAGNUM_EXPORT Timeline { * Returns time elapsed since start() was called. If the timeline is * stopped, the function returns `0.0f`. */ - GLfloat previousFrameTime() const; + Float previousFrameTime() const; /** * @brief Duration of previous frame (in seconds) * * If the timeline is stopped, the function returns `0.0f`. */ - inline constexpr GLfloat previousFrameDuration() const { + inline constexpr Float previousFrameDuration() const { return _previousFrameDuration; } private: std::chrono::high_resolution_clock::time_point _startTime; std::chrono::high_resolution_clock::time_point _previousFrameTime; - GLfloat _minimalFrameTime; - GLfloat _previousFrameDuration; + Float _minimalFrameTime; + Float _previousFrameDuration; bool running; };