Browse Source

Fixed compilation on non-GLES targets (oops).

pull/279/head
Vladimír Vondruš 14 years ago
parent
commit
d5ab207552
  1. 6
      src/AbstractTexture.cpp
  2. 10
      src/AbstractTexture.h

6
src/AbstractTexture.cpp

@ -50,7 +50,7 @@ GLfloat AbstractTexture::maxSupportedAnisotropy() {
void AbstractTexture::setMinificationFilter(Filter filter, Mipmap mipmap) { void AbstractTexture::setMinificationFilter(Filter filter, Mipmap mipmap) {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
CORRADE_ASSERT(_target != GL_TEXTURE_RECTANGLE || mipmap == Mipmap::BaseLevel, "AbstractTexture: rectangle textures cannot have mipmaps", ) CORRADE_ASSERT(_target != GL_TEXTURE_RECTANGLE || mipmap == Mipmap::BaseLevel, "AbstractTexture: rectangle textures cannot have mipmaps", );
#endif #endif
bind(); bind();
@ -60,7 +60,7 @@ void AbstractTexture::setMinificationFilter(Filter filter, Mipmap mipmap) {
void AbstractTexture::generateMipmap() { void AbstractTexture::generateMipmap() {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
CORRADE_ASSERT(_target != GL_TEXTURE_RECTANGLE, "AbstractTexture: rectangle textures cannot have mipmaps", ) CORRADE_ASSERT(_target != GL_TEXTURE_RECTANGLE, "AbstractTexture: rectangle textures cannot have mipmaps", );
#endif #endif
bind(); bind();
@ -110,7 +110,7 @@ AbstractTexture::InternalFormat::InternalFormat(AbstractTexture::Components comp
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
void AbstractTexture::DataHelper<2>::setWrapping(GLenum target, const Math::Vector<2, Wrapping>& wrapping) { void AbstractTexture::DataHelper<2>::setWrapping(GLenum target, const Math::Vector<2, Wrapping>& wrapping) {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
CORRADE_ASSERT(target != GL_TEXTURE_RECTANGLE || ((wrapping[0] == Wrapping::ClampToEdge || wrapping[0] == Wrapping::ClampToBorder) && (wrapping[0] == Wrapping::ClampToEdge || wrapping[1] == Wrapping::ClampToEdge)), "AbstractTexture: rectangle texture wrapping must either clamp to border or to edge", ) CORRADE_ASSERT(target != GL_TEXTURE_RECTANGLE || ((wrapping[0] == Wrapping::ClampToEdge || wrapping[0] == Wrapping::ClampToBorder) && (wrapping[0] == Wrapping::ClampToEdge || wrapping[1] == Wrapping::ClampToEdge)), "AbstractTexture: rectangle texture wrapping must either clamp to border or to edge", );
#endif #endif
glTexParameteri(target, GL_TEXTURE_WRAP_S, static_cast<GLint>(wrapping[0])); glTexParameteri(target, GL_TEXTURE_WRAP_S, static_cast<GLint>(wrapping[0]));

10
src/AbstractTexture.h

@ -327,19 +327,23 @@ class MAGNUM_EXPORT AbstractTexture {
* Four-component RGBA, unsigned normalized, each component 4bit, * Four-component RGBA, unsigned normalized, each component 4bit,
* 16bit total. * 16bit total.
*/ */
RGBA4 = GL_RGBA4, RGBA4 = GL_RGBA4
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
,
/** /**
* Three-component RGB, float, red and green 11bit, blue 10bit, * Three-component RGB, float, red and green 11bit, blue 10bit,
* 32bit total. * 32bit total.
* @requires_gl * @requires_gl
* @requires_gl30 Extension @extension{EXT,packed_float} * @requires_gl30 Extension @extension{EXT,packed_float}
*/ */
RG11B10Float = GL_R11F_G11F_B10F, RG11B10Float = GL_R11F_G11F_B10F
#endif #endif
#if defined(GL_RGB565) || defined(DOXYGEN_GENERATING_OUTPUT) #if defined(GL_RGB565) || defined(DOXYGEN_GENERATING_OUTPUT)
,
/** /**
* Three-component RGB, unsigned normalized, red and blue 5bit, * Three-component RGB, unsigned normalized, red and blue 5bit,
* green 6bit, 16bit total. * green 6bit, 16bit total.
@ -619,7 +623,7 @@ class MAGNUM_EXPORT AbstractTexture {
* to `ClampToBorder`. * to `ClampToBorder`.
* @requires_gl * @requires_gl
*/ */
inline void setBorderColor(const Color4& color) { inline void setBorderColor(const Color4<GLfloat>& color) {
bind(); bind();
glTexParameterfv(_target, GL_TEXTURE_BORDER_COLOR, color.data()); glTexParameterfv(_target, GL_TEXTURE_BORDER_COLOR, color.data());
} }

Loading…
Cancel
Save