Browse Source

Be more defensive in getting max texture slot count.

pull/51/head
Vladimír Vondruš 12 years ago
parent
commit
171af7cda9
  1. 3
      src/Magnum/Implementation/TextureState.cpp

3
src/Magnum/Implementation/TextureState.cpp

@ -34,7 +34,7 @@
namespace Magnum { namespace Implementation { namespace Magnum { namespace Implementation {
TextureState::TextureState(Context& context, std::vector<std::string>& extensions): maxMaxAnisotropy(0.0f), currentLayer(0) TextureState::TextureState(Context& context, std::vector<std::string>& extensions): maxLayers(0), maxMaxAnisotropy(0.0f), currentLayer(0)
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
, maxColorSamples(0), maxDepthSamples(0), maxIntegerSamples(0), bufferOffsetAlignment(0) , maxColorSamples(0), maxDepthSamples(0), maxIntegerSamples(0), bufferOffsetAlignment(0)
#endif #endif
@ -160,6 +160,7 @@ TextureState::TextureState(Context& context, std::vector<std::string>& extension
/* Resize bindings array to hold all possible layers */ /* Resize bindings array to hold all possible layers */
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxLayers); glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxLayers);
CORRADE_INTERNAL_ASSERT(maxLayers > 0);
bindings.resize(maxLayers); bindings.resize(maxLayers);
} }

Loading…
Cancel
Save