diff --git a/src/AbstractFramebuffer.cpp b/src/AbstractFramebuffer.cpp index 2b9043bdb..56e95f9ba 100644 --- a/src/AbstractFramebuffer.cpp +++ b/src/AbstractFramebuffer.cpp @@ -112,7 +112,7 @@ void AbstractFramebuffer::bindInternal(FramebufferTarget target) { state->readBinding = state->drawBinding = _id; } else CORRADE_ASSERT_UNREACHABLE(); - glBindFramebuffer(static_cast(target), _id); + glBindFramebuffer(GLenum(target), _id); } FramebufferTarget AbstractFramebuffer::bindInternal() { @@ -144,7 +144,7 @@ void AbstractFramebuffer::blit(AbstractFramebuffer& source, AbstractFramebuffer& destination.bindInternal(FramebufferTarget::Draw); /** @todo Get some extension wrangler instead to avoid undeclared glBlitFramebuffer() on ES2 */ #ifndef MAGNUM_TARGET_GLES2 - glBlitFramebuffer(sourceRectangle.left(), sourceRectangle.bottom(), sourceRectangle.right(), sourceRectangle.top(), destinationRectangle.left(), destinationRectangle.bottom(), destinationRectangle.right(), destinationRectangle.top(), static_cast(mask), static_cast(filter)); + glBlitFramebuffer(sourceRectangle.left(), sourceRectangle.bottom(), sourceRectangle.right(), sourceRectangle.top(), destinationRectangle.left(), destinationRectangle.bottom(), destinationRectangle.right(), destinationRectangle.top(), GLbitfield(mask), GLenum(filter)); #else static_cast(sourceRectangle); static_cast(destinationRectangle); @@ -183,7 +183,7 @@ void AbstractFramebuffer::clear(FramebufferClearMask mask) { #else bindInternal(drawTarget); #endif - glClear(static_cast(mask)); + glClear(GLbitfield(mask)); } void AbstractFramebuffer::read(const Vector2i& offset, const Vector2i& size, Image2D& image) { @@ -377,17 +377,17 @@ void AbstractFramebuffer::readBufferImplementationDSA(GLenum buffer) { #endif void AbstractFramebuffer::readImplementationDefault(const Vector2i& offset, const Vector2i& size, const ColorFormat format, const ColorType type, const std::size_t, GLvoid* const data) { - glReadPixels(offset.x(), offset.y(), size.x(), size.y(), static_cast(format), static_cast(type), data); + glReadPixels(offset.x(), offset.y(), size.x(), size.y(), GLenum(format), GLenum(type), data); } #ifndef MAGNUM_TARGET_GLES3 void AbstractFramebuffer::readImplementationRobustness(const Vector2i& offset, const Vector2i& size, const ColorFormat format, const ColorType type, const std::size_t dataSize, GLvoid* const data) { /** @todo Enable when extension wrangler for ES is available */ #ifndef MAGNUM_TARGET_GLES - glReadnPixelsARB(offset.x(), offset.y(), size.x(), size.y(), static_cast(format), static_cast(type), dataSize, data); + glReadnPixelsARB(offset.x(), offset.y(), size.x(), size.y(), GLenum(format), GLenum(type), dataSize, data); #else CORRADE_INTERNAL_ASSERT(false); - //glReadnPixelsEXT(offset.x(), offset.y(), size.x(), size.y(), static_cast(format), static_cast(type), data); + //glReadnPixelsEXT(offset.x(), offset.y(), size.x(), size.y(), GLenum(format), GLenum(type), data); static_cast(offset); static_cast(size); static_cast(format); diff --git a/src/AbstractTexture.cpp b/src/AbstractTexture.cpp index a49539ca4..c43b6ce3d 100644 --- a/src/AbstractTexture.cpp +++ b/src/AbstractTexture.cpp @@ -190,8 +190,7 @@ AbstractTexture& AbstractTexture::setMinificationFilter(Sampler::Filter filter, CORRADE_ASSERT(_target != GL_TEXTURE_RECTANGLE || mipmap == Sampler::Mipmap::Base, "AbstractTexture: rectangle textures cannot have mipmaps", *this); #endif - (this->*parameteriImplementation)(GL_TEXTURE_MIN_FILTER, - static_cast(filter)|static_cast(mipmap)); + (this->*parameteriImplementation)(GL_TEXTURE_MIN_FILTER, GLint(filter)|GLint(mipmap)); return *this; } @@ -886,22 +885,22 @@ void AbstractTexture::getImageImplementationRobustness(const GLenum target, cons #ifndef MAGNUM_TARGET_GLES void AbstractTexture::imageImplementationDefault(GLenum target, GLint level, TextureFormat internalFormat, const Math::Vector<1, GLsizei>& size, ColorFormat format, ColorType type, const GLvoid* data) { bindInternal(); - glTexImage1D(target, level, static_cast(internalFormat), size[0], 0, static_cast(format), static_cast(type), data); + glTexImage1D(target, level, GLint(internalFormat), size[0], 0, GLenum(format), GLenum(type), data); } void AbstractTexture::imageImplementationDSA(GLenum target, GLint level, TextureFormat internalFormat, const Math::Vector<1, GLsizei>& size, ColorFormat format, ColorType type, const GLvoid* data) { - glTextureImage1DEXT(_id, target, level, GLint(internalFormat), size[0], 0, static_cast(format), static_cast(type), data); + glTextureImage1DEXT(_id, target, level, GLint(internalFormat), size[0], 0, GLenum(format), GLenum(type), data); } #endif void AbstractTexture::imageImplementationDefault(GLenum target, GLint level, TextureFormat internalFormat, const Vector2i& size, ColorFormat format, ColorType type, const GLvoid* data) { bindInternal(); - glTexImage2D(target, level, GLint(internalFormat), size.x(), size.y(), 0, static_cast(format), static_cast(type), data); + glTexImage2D(target, level, GLint(internalFormat), size.x(), size.y(), 0, GLenum(format), GLenum(type), data); } #ifndef MAGNUM_TARGET_GLES void AbstractTexture::imageImplementationDSA(GLenum target, GLint level, TextureFormat internalFormat, const Vector2i& size, ColorFormat format, ColorType type, const GLvoid* data) { - glTextureImage2DEXT(_id, target, level, GLint(internalFormat), size.x(), size.y(), 0, static_cast(format), static_cast(type), data); + glTextureImage2DEXT(_id, target, level, GLint(internalFormat), size.x(), size.y(), 0, GLenum(format), GLenum(type), data); } #endif @@ -909,7 +908,7 @@ void AbstractTexture::imageImplementationDefault(GLenum target, GLint level, Tex bindInternal(); /** @todo Get some extension wrangler instead to avoid linker errors to glTexImage3D() on ES2 */ #ifndef MAGNUM_TARGET_GLES2 - glTexImage3D(target, level, GLint(internalFormat), size.x(), size.y(), size.z(), 0, static_cast(format), static_cast(type), data); + glTexImage3D(target, level, GLint(internalFormat), size.x(), size.y(), size.z(), 0, GLenum(format), GLenum(type), data); #else static_cast(target); static_cast(level); @@ -923,29 +922,29 @@ void AbstractTexture::imageImplementationDefault(GLenum target, GLint level, Tex #ifndef MAGNUM_TARGET_GLES void AbstractTexture::imageImplementationDSA(GLenum target, GLint level, TextureFormat internalFormat, const Vector3i& size, ColorFormat format, ColorType type, const GLvoid* data) { - glTextureImage3DEXT(_id, target, level, GLint(internalFormat), size.x(), size.y(), size.z(), 0, static_cast(format), static_cast(type), data); + glTextureImage3DEXT(_id, target, level, GLint(internalFormat), size.x(), size.y(), size.z(), 0, GLenum(format), GLenum(type), data); } #endif #ifndef MAGNUM_TARGET_GLES void AbstractTexture::subImageImplementationDefault(GLenum target, GLint level, const Math::Vector<1, GLint>& offset, const Math::Vector<1, GLsizei>& size, ColorFormat format, ColorType type, const GLvoid* data) { bindInternal(); - glTexSubImage1D(target, level, offset[0], size[0], static_cast(format), static_cast(type), data); + glTexSubImage1D(target, level, offset[0], size[0], GLenum(format), GLenum(type), data); } void AbstractTexture::subImageImplementationDSA(GLenum target, GLint level, const Math::Vector<1, GLint>& offset, const Math::Vector<1, GLsizei>& size, ColorFormat format, ColorType type, const GLvoid* data) { - glTextureSubImage1DEXT(_id, target, level, offset[0], size[0], static_cast(format), static_cast(type), data); + glTextureSubImage1DEXT(_id, target, level, offset[0], size[0], GLenum(format), GLenum(type), data); } #endif void AbstractTexture::subImageImplementationDefault(GLenum target, GLint level, const Vector2i& offset, const Vector2i& size, ColorFormat format, ColorType type, const GLvoid* data) { bindInternal(); - glTexSubImage2D(target, level, offset.x(), offset.y(), size.x(), size.y(), static_cast(format), static_cast(type), data); + glTexSubImage2D(target, level, offset.x(), offset.y(), size.x(), size.y(), GLenum(format), GLenum(type), data); } #ifndef MAGNUM_TARGET_GLES void AbstractTexture::subImageImplementationDSA(GLenum target, GLint level, const Vector2i& offset, const Vector2i& size, ColorFormat format, ColorType type, const GLvoid* data) { - glTextureSubImage2DEXT(_id, target, level, offset.x(), offset.y(), size.x(), size.y(), static_cast(format), static_cast(type), data); + glTextureSubImage2DEXT(_id, target, level, offset.x(), offset.y(), size.x(), size.y(), GLenum(format), GLenum(type), data); } #endif @@ -953,7 +952,7 @@ void AbstractTexture::subImageImplementationDefault(GLenum target, GLint level, bindInternal(); /** @todo Get some extension wrangler instead to avoid linker errors to glTexSubImage3D() on ES2 */ #ifndef MAGNUM_TARGET_GLES2 - glTexSubImage3D(target, level, offset.x(), offset.y(), offset.z(), size.x(), size.y(), size.z(), static_cast(format), static_cast(type), data); + glTexSubImage3D(target, level, offset.x(), offset.y(), offset.z(), size.x(), size.y(), size.z(), GLenum(format), GLenum(type), data); #else static_cast(target); static_cast(level); @@ -967,7 +966,7 @@ void AbstractTexture::subImageImplementationDefault(GLenum target, GLint level, #ifndef MAGNUM_TARGET_GLES void AbstractTexture::subImageImplementationDSA(GLenum target, GLint level, const Vector3i& offset, const Vector3i& size, ColorFormat format, ColorType type, const GLvoid* data) { - glTextureSubImage3DEXT(_id, target, level, offset.x(), offset.y(), offset.z(), size.x(), size.y(), size.z(), static_cast(format), static_cast(type), data); + glTextureSubImage3DEXT(_id, target, level, offset.x(), offset.y(), offset.z(), size.x(), size.y(), size.z(), GLenum(format), GLenum(type), data); } #endif @@ -1124,15 +1123,15 @@ void AbstractTexture::DataHelper<2>::setWrapping(AbstractTexture* texture, const CORRADE_ASSERT(texture->_target != GL_TEXTURE_RECTANGLE || ((wrapping.x() == Sampler::Wrapping::ClampToEdge || wrapping.x() == Sampler::Wrapping::ClampToBorder) && (wrapping.y() == Sampler::Wrapping::ClampToEdge || wrapping.y() == Sampler::Wrapping::ClampToEdge)), "AbstractTexture: rectangle texture wrapping must either clamp to border or to edge", ); #endif - (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_S, static_cast(wrapping.x())); - (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_T, static_cast(wrapping.y())); + (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_S, GLint(wrapping.x())); + (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_T, GLint(wrapping.y())); } void AbstractTexture::DataHelper<3>::setWrapping(AbstractTexture* texture, const Array3D& wrapping) { - (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_S, static_cast(wrapping.x())); - (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_T, static_cast(wrapping.y())); + (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_S, GLint(wrapping.x())); + (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_T, GLint(wrapping.y())); #ifndef MAGNUM_TARGET_GLES - (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_R, static_cast(wrapping.z())); + (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_R, GLint(wrapping.z())); #endif } #endif diff --git a/src/AbstractTexture.h b/src/AbstractTexture.h index 69befeed2..815b6c811 100644 --- a/src/AbstractTexture.h +++ b/src/AbstractTexture.h @@ -216,7 +216,7 @@ class MAGNUM_EXPORT AbstractTexture { * with @def_gl{TEXTURE_MAG_FILTER} */ AbstractTexture& setMagnificationFilter(Sampler::Filter filter) { - (this->*parameteriImplementation)(GL_TEXTURE_MAG_FILTER, static_cast(filter)); + (this->*parameteriImplementation)(GL_TEXTURE_MAG_FILTER, GLint(filter)); return *this; } @@ -478,7 +478,7 @@ template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<1> { static Math::Vector<1, GLint> imageSize(AbstractTexture* texture, GLenum target, GLint level); static void setWrapping(AbstractTexture* texture, const Array1D& wrapping) { - (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_S, static_cast(wrapping.x())); + (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_S, GLint(wrapping.x())); } static void setStorage(AbstractTexture* texture, GLenum target, GLsizei levels, TextureFormat internalFormat, const Math::Vector<1, GLsizei>& size) { diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 507f080da..e343bea04 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -170,7 +170,7 @@ void Buffer::bind(Target target, GLuint id) { /* Bind the buffer otherwise */ bound = id; - glBindBuffer(static_cast(target), id); + glBindBuffer(GLenum(target), id); } Buffer::Target Buffer::bindInternal(Target hint) { @@ -187,7 +187,7 @@ Buffer::Target Buffer::bindInternal(Target hint) { /* Bind the buffer to hint target otherwise */ hintBinding = _id; - glBindBuffer(static_cast(hint), _id); + glBindBuffer(GLenum(hint), _id); return hint; } @@ -206,7 +206,7 @@ void* Buffer::mapSub(const GLintptr offset, const GLsizeiptr length, const MapAc /** @todo Enable also in Emscripten (?) when extension wrangler is available */ #ifdef CORRADE_TARGET_NACL CORRADE_ASSERT(!_mappedBuffer, "Buffer::mapSub(): the buffer is already mapped", nullptr); - return _mappedBuffer = glMapBufferSubDataCHROMIUM(static_cast(bindInternal(_targetHint)), offset, length, GLenum(access)); + return _mappedBuffer = glMapBufferSubDataCHROMIUM(GLenum(bindInternal(_targetHint)), offset, length, GLenum(access)); #else CORRADE_INTERNAL_ASSERT(false); static_cast(offset); @@ -228,7 +228,7 @@ void Buffer::unmapSub() { #ifndef MAGNUM_TARGET_GLES2 void Buffer::copyImplementationDefault(Buffer& read, Buffer& write, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) { - glCopyBufferSubData(static_cast(read.bindInternal(Target::CopyRead)), static_cast(write.bindInternal(Target::CopyWrite)), readOffset, writeOffset, size); + glCopyBufferSubData(GLenum(read.bindInternal(Target::CopyRead)), GLenum(write.bindInternal(Target::CopyWrite)), readOffset, writeOffset, size); } #ifndef MAGNUM_TARGET_GLES @@ -259,17 +259,17 @@ void Buffer::getSubDataImplementationDSA(const GLintptr offset, const GLsizeiptr #endif void Buffer::dataImplementationDefault(GLsizeiptr size, const GLvoid* data, Buffer::Usage usage) { - glBufferData(static_cast(bindInternal(_targetHint)), size, data, static_cast(usage)); + glBufferData(GLenum(bindInternal(_targetHint)), size, data, GLenum(usage)); } #ifndef MAGNUM_TARGET_GLES void Buffer::dataImplementationDSA(GLsizeiptr size, const GLvoid* data, Buffer::Usage usage) { - glNamedBufferDataEXT(_id, size, data, static_cast(usage)); + glNamedBufferDataEXT(_id, size, data, GLenum(usage)); } #endif void Buffer::subDataImplementationDefault(GLintptr offset, GLsizeiptr size, const GLvoid* data) { - glBufferSubData(static_cast(bindInternal(_targetHint)), offset, size, data); + glBufferSubData(GLenum(bindInternal(_targetHint)), offset, size, data); } #ifndef MAGNUM_TARGET_GLES @@ -298,7 +298,7 @@ void Buffer::invalidateSubImplementationARB(GLintptr offset, GLsizeiptr length) void* Buffer::mapImplementationDefault(MapAccess access) { /** @todo Re-enable when extension wrangler is available for ES */ #ifndef MAGNUM_TARGET_GLES - return glMapBuffer(static_cast(bindInternal(_targetHint)), GLenum(access)); + return glMapBuffer(GLenum(bindInternal(_targetHint)), GLenum(access)); #else static_cast(access); return nullptr; @@ -315,7 +315,7 @@ void* Buffer::mapImplementationDSA(MapAccess access) { void* Buffer::mapRangeImplementationDefault(GLintptr offset, GLsizeiptr length, MapFlags access) { /** @todo Re-enable when extension wrangler is available for ES */ #ifndef MAGNUM_TARGET_GLES2 - return glMapBufferRange(static_cast(bindInternal(_targetHint)), offset, length, GLenum(access)); + return glMapBufferRange(GLenum(bindInternal(_targetHint)), offset, length, GLenum(access)); #else static_cast(offset); static_cast(length); @@ -333,7 +333,7 @@ void* Buffer::mapRangeImplementationDSA(GLintptr offset, GLsizeiptr length, MapF void Buffer::flushMappedRangeImplementationDefault(GLintptr offset, GLsizeiptr length) { /** @todo Re-enable when extension wrangler is available for ES */ #ifndef MAGNUM_TARGET_GLES2 - glFlushMappedBufferRange(static_cast(bindInternal(_targetHint)), offset, length); + glFlushMappedBufferRange(GLenum(bindInternal(_targetHint)), offset, length); #else static_cast(offset); static_cast(length); @@ -349,7 +349,7 @@ void Buffer::flushMappedRangeImplementationDSA(GLintptr offset, GLsizeiptr lengt bool Buffer::unmapImplementationDefault() { /** @todo Re-enable when extension wrangler is available for ES */ #ifndef MAGNUM_TARGET_GLES2 - return glUnmapBuffer(static_cast(bindInternal(_targetHint))); + return glUnmapBuffer(GLenum(bindInternal(_targetHint))); #else return false; #endif diff --git a/src/CubeMapTexture.h b/src/CubeMapTexture.h index 4505bf0d4..b69237a1a 100644 --- a/src/CubeMapTexture.h +++ b/src/CubeMapTexture.h @@ -116,7 +116,7 @@ class CubeMapTexture: public AbstractTexture { * @requires_gl %Texture image queries are not available in OpenGL ES. */ Vector2i imageSize(Coordinate coordinate, Int level) { - return DataHelper<2>::imageSize(this, static_cast(coordinate), level); + return DataHelper<2>::imageSize(this, GLenum(coordinate), level); } #endif @@ -171,14 +171,14 @@ class CubeMapTexture: public AbstractTexture { * See Texture::setImage() for more information. */ CubeMapTexture& setImage(Coordinate coordinate, Int level, TextureFormat internalFormat, const ImageReference2D& image) { - DataHelper<2>::setImage(this, static_cast(coordinate), level, internalFormat, image); + DataHelper<2>::setImage(this, GLenum(coordinate), level, internalFormat, image); return *this; } #ifndef MAGNUM_TARGET_GLES2 /** @overload */ CubeMapTexture& setImage(Coordinate coordinate, Int level, TextureFormat internalFormat, BufferImage2D& image) { - DataHelper<2>::setImage(this, static_cast(coordinate), level, internalFormat, image); + DataHelper<2>::setImage(this, GLenum(coordinate), level, internalFormat, image); return *this; } #endif @@ -194,14 +194,14 @@ class CubeMapTexture: public AbstractTexture { * See Texture::setSubImage() for more information. */ CubeMapTexture& setSubImage(Coordinate coordinate, Int level, const Vector2i& offset, const ImageReference2D& image) { - DataHelper<2>::setSubImage(this, static_cast(coordinate), level, offset, image); + DataHelper<2>::setSubImage(this, GLenum(coordinate), level, offset, image); return *this; } #ifndef MAGNUM_TARGET_GLES2 /** @overload */ CubeMapTexture& setSubImage(Coordinate coordinate, Int level, const Vector2i& offset, BufferImage2D& image) { - DataHelper<2>::setSubImage(this, static_cast(coordinate), level, offset, image); + DataHelper<2>::setSubImage(this, GLenum(coordinate), level, offset, image); return *this; } #endif diff --git a/src/CubeMapTextureArray.h b/src/CubeMapTextureArray.h index 0f61a1f5c..feeccd090 100644 --- a/src/CubeMapTextureArray.h +++ b/src/CubeMapTextureArray.h @@ -118,7 +118,7 @@ class CubeMapTextureArray: public AbstractTexture { * See Texture::imageSize() for more information. */ Vector3i imageSize(Coordinate coordinate, Int level) { - return DataHelper<3>::imageSize(this, GL_TEXTURE_CUBE_MAP_POSITIVE_X + static_cast(coordinate), level); + return DataHelper<3>::imageSize(this, GL_TEXTURE_CUBE_MAP_POSITIVE_X + GLenum(coordinate), level); } /** diff --git a/src/DefaultFramebuffer.cpp b/src/DefaultFramebuffer.cpp index 02fabecdd..9f165a1bc 100644 --- a/src/DefaultFramebuffer.cpp +++ b/src/DefaultFramebuffer.cpp @@ -48,7 +48,7 @@ DefaultFramebuffer& DefaultFramebuffer::mapForDraw(std::initializer_list(attachment.second); + _attachments[attachment.first] = GLenum(attachment.second); (this->*drawBuffersImplementation)(max+1, _attachments); delete[] _attachments; diff --git a/src/DefaultFramebuffer.h b/src/DefaultFramebuffer.h index c7e7ee0fa..d1bdc2671 100644 --- a/src/DefaultFramebuffer.h +++ b/src/DefaultFramebuffer.h @@ -349,7 +349,7 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer { * available only in OpenGL ES 3.0. */ DefaultFramebuffer& mapForDraw(DrawAttachment attachment) { - (this->*drawBufferImplementation)(static_cast(attachment)); + (this->*drawBufferImplementation)(GLenum(attachment)); return *this; } #endif @@ -367,7 +367,7 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer { * @requires_gles30 %Extension @es_extension2{NV,read_buffer,GL_NV_read_buffer} */ DefaultFramebuffer& mapForRead(ReadAttachment attachment) { - (this->*readBufferImplementation)(static_cast(attachment)); + (this->*readBufferImplementation)(GLenum(attachment)); return *this; } diff --git a/src/Framebuffer.cpp b/src/Framebuffer.cpp index c332f2db8..189319243 100644 --- a/src/Framebuffer.cpp +++ b/src/Framebuffer.cpp @@ -157,7 +157,7 @@ void Framebuffer::renderbufferImplementationDSA(BufferAttachment attachment, Ren } void Framebuffer::texture1DImplementationDefault(BufferAttachment attachment, Texture1D& texture, GLint mipLevel) { - glFramebufferTexture1D(GLenum(bindInternal()), GLenum(attachment), static_cast(texture.target()), texture.id(), mipLevel); + glFramebufferTexture1D(GLenum(bindInternal()), GLenum(attachment), GLenum(texture.target()), texture.id(), mipLevel); } void Framebuffer::texture1DImplementationDSA(BufferAttachment attachment, Texture1D& texture, GLint mipLevel) { @@ -179,7 +179,7 @@ void Framebuffer::texture3DImplementationDefault(BufferAttachment attachment, Te /** @todo Check for texture target compatibility */ /** @todo Get some extension wrangler for glFramebufferTexture3D() (extension only) */ #ifndef MAGNUM_TARGET_GLES - glFramebufferTexture3D(GLenum(bindInternal()), GLenum(attachment), static_cast(texture.target()), texture.id(), mipLevel, layer); + glFramebufferTexture3D(GLenum(bindInternal()), GLenum(attachment), GLenum(texture.target()), texture.id(), mipLevel, layer); #else static_cast(attachment); static_cast(texture); diff --git a/src/Mesh.cpp b/src/Mesh.cpp index 8755b8ad3..8c8cdd234 100644 --- a/src/Mesh.cpp +++ b/src/Mesh.cpp @@ -169,17 +169,17 @@ void Mesh::drawInternal(Int firstVertex, Int vertexCount, GLintptr indexOffset, /* Non-indexed mesh */ if(!indexCount) - glDrawArrays(static_cast(_primitive), firstVertex, vertexCount); + glDrawArrays(GLenum(_primitive), firstVertex, vertexCount); #ifndef MAGNUM_TARGET_GLES2 /* Indexed mesh with specified range */ else if(indexEnd) - glDrawRangeElements(static_cast(_primitive), indexStart, indexEnd, indexCount, static_cast(_indexType), reinterpret_cast(indexOffset)); + glDrawRangeElements(GLenum(_primitive), indexStart, indexEnd, indexCount, GLenum(_indexType), reinterpret_cast(indexOffset)); #endif /* Indexed mesh without specified range */ else - glDrawElements(static_cast(_primitive), indexCount, static_cast(_indexType), reinterpret_cast(indexOffset)); + glDrawElements(GLenum(_primitive), indexCount, GLenum(_indexType), reinterpret_cast(indexOffset)); (this->*unbindImplementation)(); } diff --git a/src/Mesh.h b/src/Mesh.h index ddaf9827e..6888d8ced 100644 --- a/src/Mesh.h +++ b/src/Mesh.h @@ -639,8 +639,8 @@ class MAGNUM_EXPORT Mesh { (this->*attributePointerImplementation)(Attribute{ &buffer, location+i, - static_cast(attribute.components()), - static_cast(attribute.dataType()), + GLint(attribute.components()), + GLenum(attribute.dataType()), bool(attribute.dataOptions() & AbstractShaderProgram::Attribute::DataOption::Normalized), offset, stride @@ -652,8 +652,8 @@ class MAGNUM_EXPORT Mesh { (this->*attributeIPointerImplementation)(IntegerAttribute{ &buffer, location, - static_cast(attribute.components()), - static_cast(attribute.dataType()), + GLint(attribute.components()), + GLenum(attribute.dataType()), offset, stride }); @@ -665,8 +665,8 @@ class MAGNUM_EXPORT Mesh { (this->*attributeLPointerImplementation)(LongAttribute{ &buffer, location+i, - static_cast(attribute.components()), - static_cast(attribute.dataType()), + GLint(attribute.components()), + GLenum(attribute.dataType()), offset, stride }); diff --git a/src/Query.h b/src/Query.h index aebfddbfb..624d33969 100644 --- a/src/Query.h +++ b/src/Query.h @@ -291,7 +291,7 @@ class SampleQuery: public AbstractQuery { * @requires_gl Conditional rendering is not available in OpenGL ES. */ void beginConditionalRender(ConditionalRenderMode mode) { - glBeginConditionalRender(id(), static_cast(mode)); + glBeginConditionalRender(id(), GLenum(mode)); } /** diff --git a/src/Shader.cpp b/src/Shader.cpp index d69e12778..1767ce98b 100644 --- a/src/Shader.cpp +++ b/src/Shader.cpp @@ -534,7 +534,7 @@ Int Shader::maxCombinedUniformComponents(const Type type) { #endif Shader::Shader(const Version version, const Type type): _type(type), _id(0) { - _id = glCreateShader(static_cast(_type)); + _id = glCreateShader(GLenum(_type)); switch(version) { #ifndef MAGNUM_TARGET_GLES diff --git a/src/Texture.h b/src/Texture.h index 615f8665e..517f050b9 100644 --- a/src/Texture.h +++ b/src/Texture.h @@ -227,7 +227,7 @@ template class Texture: public AbstractTexture { * Creates one OpenGL texture. * @see @fn_gl{GenTextures} */ - explicit Texture(Target target = DataHelper::target()): AbstractTexture(static_cast(target)) {} + explicit Texture(Target target = DataHelper::target()): AbstractTexture(GLenum(target)) {} /** @brief %Texture target */ constexpr Target target() const { return static_cast(_target); }