summaryrefslogtreecommitdiffstats
path: root/src/graphics/opengl/gldevice.cpp
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-08-13 23:09:30 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-08-13 23:09:30 +0200
commit5b45911856442ee7cbd451125c47fd13f21db58e (patch)
treed843bc18e4b777628faec617510d663e5cfaa01a /src/graphics/opengl/gldevice.cpp
parenta2dd39960b5851f8e62adf59b11b36ba14626468 (diff)
downloadcolobot-5b45911856442ee7cbd451125c47fd13f21db58e.tar.gz
colobot-5b45911856442ee7cbd451125c47fd13f21db58e.tar.bz2
colobot-5b45911856442ee7cbd451125c47fd13f21db58e.zip
Improved error messages
Added some logging and improved error messages displayed to user
Diffstat (limited to 'src/graphics/opengl/gldevice.cpp')
-rw-r--r--src/graphics/opengl/gldevice.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp
index 3526b13..7221421 100644
--- a/src/graphics/opengl/gldevice.cpp
+++ b/src/graphics/opengl/gldevice.cpp
@@ -20,6 +20,7 @@
#include "common/config.h"
#include "common/image.h"
+#include "common/logger.h"
#include "math/geometry.h"
@@ -80,13 +81,10 @@ void Gfx::CGLDevice::DebugHook()
glColor3i(0, 0, 0);
}
-std::string Gfx::CGLDevice::GetError()
-{
- return m_error;
-}
-
bool Gfx::CGLDevice::Create()
{
+ GetLogger()->Info("Creating CDevice\n");
+
#if defined(USE_GLEW)
static bool glewInited = false;
@@ -96,13 +94,13 @@ bool Gfx::CGLDevice::Create()
if (glewInit() != GLEW_OK)
{
- m_error = "GLEW initialization failed";
+ GetLogger()->Error("GLEW initialization failed\n");
return false;
}
if ( (! GLEW_ARB_multitexture) || (! GLEW_EXT_texture_env_combine) || (! GLEW_EXT_secondary_color) )
{
- m_error = "GLEW reports required extensions not supported";
+ GetLogger()->Error("GLEW reports required extensions not supported\n");
return false;
}
}
@@ -142,6 +140,8 @@ bool Gfx::CGLDevice::Create()
m_texturesEnabled = std::vector<bool> (maxTextures, false);
m_textureStageParams = std::vector<Gfx::TextureStageParams>(maxTextures, Gfx::TextureStageParams());
+ GetLogger()->Info("CDevice created successfully\n");
+
return true;
}
@@ -385,7 +385,7 @@ Gfx::Texture Gfx::CGLDevice::CreateTexture(CImage *image, const Gfx::TextureCrea
ImageData *data = image->GetData();
if (data == NULL)
{
- m_error = "Invalid texture data";
+ GetLogger()->Error("Invalid texture data\n");
return Gfx::Texture(); // invalid texture
}