From 050f9d25428d8298b010c73e9721d7b7203ef31f Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sun, 16 Sep 2012 20:39:32 +0200 Subject: Fix max lights error --- src/graphics/opengl/gldevice.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp index a779a5f..09efeb3 100644 --- a/src/graphics/opengl/gldevice.cpp +++ b/src/graphics/opengl/gldevice.cpp @@ -129,9 +129,11 @@ bool Gfx::CGLDevice::Create() glViewport(0, 0, m_config.size.x, m_config.size.y); + int numLights = 0; + glGetIntegerv(GL_MAX_LIGHTS, &numLights); - m_lights = std::vector(GL_MAX_LIGHTS, Gfx::Light()); - m_lightsEnabled = std::vector (GL_MAX_LIGHTS, false); + m_lights = std::vector(numLights, Gfx::Light()); + m_lightsEnabled = std::vector (numLights, false); int maxTextures = 0; glGetIntegerv(GL_MAX_TEXTURE_UNITS, &maxTextures); -- cgit v1.2.3-1-g7c22