diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2012-09-16 20:39:32 +0200 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2012-09-16 20:39:32 +0200 |
commit | 050f9d25428d8298b010c73e9721d7b7203ef31f (patch) | |
tree | c5d0f7397e9545aefa49f0ce2f22250e07585c4e | |
parent | 2e21435f432191afa1b0f609daa8ca9d4cde1e93 (diff) | |
download | colobot-050f9d25428d8298b010c73e9721d7b7203ef31f.tar.gz colobot-050f9d25428d8298b010c73e9721d7b7203ef31f.tar.bz2 colobot-050f9d25428d8298b010c73e9721d7b7203ef31f.zip |
Fix max lights error
-rw-r--r-- | src/graphics/opengl/gldevice.cpp | 6 |
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); |