summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/graphicsmanager.cpp7
-rw-r--r--src/graphicsmanager.h2
-rw-r--r--src/render/modernopenglgraphics.cpp5
3 files changed, 14 insertions, 0 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index 4661563e2..bc836d381 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -1188,6 +1188,13 @@ std::string GraphicsManager::errorToString(const GLenum error)
return "";
}
+void GraphicsManager::logError()
+{
+ const GLenum error = GraphicsManager::getLastError();
+ if (error != GL_NO_ERROR)
+ logger->log(errorToString(error));
+}
+
void GraphicsManager::detectVideoSettings()
{
config.setValue("videodetected", true);
diff --git a/src/graphicsmanager.h b/src/graphicsmanager.h
index 963e8dbb7..a0af8c41b 100644
--- a/src/graphicsmanager.h
+++ b/src/graphicsmanager.h
@@ -156,6 +156,8 @@ class GraphicsManager final
static std::string errorToString(const GLenum error) A_WARN_UNUSED;
+ static void logError();
+
void updateDebugLog() const;
std::string getGLVersion() const
diff --git a/src/render/modernopenglgraphics.cpp b/src/render/modernopenglgraphics.cpp
index a166f64b9..96ce5e1ef 100644
--- a/src/render/modernopenglgraphics.cpp
+++ b/src/render/modernopenglgraphics.cpp
@@ -162,6 +162,11 @@ void ModernOpenGLGraphics::postInit()
logger->log("Compiling shaders");
mProgram = shaders.getSimpleProgram();
+ if (!mProgram)
+ {
+ graphicsManager.logError();
+ logger->safeError("Shader creation error. See manaplus.log.");
+ }
mProgramId = mProgram->getProgramId();
if (!mProgram)
logger->error("Shaders compilation error.");