summaryrefslogtreecommitdiffstats
path: root/src/graphics/opengl
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-09-16 20:39:32 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-09-16 20:39:32 +0200
commit050f9d25428d8298b010c73e9721d7b7203ef31f (patch)
treec5d0f7397e9545aefa49f0ce2f22250e07585c4e /src/graphics/opengl
parent2e21435f432191afa1b0f609daa8ca9d4cde1e93 (diff)
downloadcolobot-050f9d25428d8298b010c73e9721d7b7203ef31f.tar.gz
colobot-050f9d25428d8298b010c73e9721d7b7203ef31f.tar.bz2
colobot-050f9d25428d8298b010c73e9721d7b7203ef31f.zip
Fix max lights error
Diffstat (limited to 'src/graphics/opengl')
-rw-r--r--src/graphics/opengl/gldevice.cpp6
1 files 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<Gfx::Light>(GL_MAX_LIGHTS, Gfx::Light());
- m_lightsEnabled = std::vector<bool> (GL_MAX_LIGHTS, false);
+ m_lights = std::vector<Gfx::Light>(numLights, Gfx::Light());
+ m_lightsEnabled = std::vector<bool> (numLights, false);
int maxTextures = 0;
glGetIntegerv(GL_MAX_TEXTURE_UNITS, &maxTextures);