Added information about graphics card to error message
parent
97558530ce
commit
22e963e2c4
|
@ -191,7 +191,8 @@ bool CGL21Device::Create()
|
|||
GetLogger()->Error("OpenGL 2.0 or newer is required to use this engine.\n");
|
||||
m_errorMessage = "It seems your graphics card does not support OpenGL 2.0.\n";
|
||||
m_errorMessage += "Please make sure you have appropriate hardware and newest drivers installed.\n";
|
||||
m_errorMessage += "(OpenGL 2.0 is roughly equivalent to Direct3D 9)";
|
||||
m_errorMessage += "(OpenGL 2.0 is roughly equivalent to Direct3D 9)\n\n";
|
||||
m_errorMessage += GetHardwareInfo(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -192,7 +192,8 @@ bool CGL33Device::Create()
|
|||
GetLogger()->Error("OpenGL 3.0 or newer is required to use this engine.\n");
|
||||
m_errorMessage = "It seems your graphics card does not support OpenGL 3.0.\n";
|
||||
m_errorMessage += "Please make sure you have appropriate hardware and newest drivers installed.\n";
|
||||
m_errorMessage += "(OpenGL 3.0 is roughly equivalent to Direct3D 10)";
|
||||
m_errorMessage += "(OpenGL 3.0 is roughly equivalent to Direct3D 10)\n\n";
|
||||
m_errorMessage += GetHardwareInfo(false);
|
||||
return false;
|
||||
}
|
||||
else if (glVersion < 33)
|
||||
|
|
|
@ -187,7 +187,8 @@ bool CGLDevice::Create()
|
|||
GetLogger()->Error("Unsupported OpenGL version: %d.%d\n", m_glMajor, m_glMinor);
|
||||
GetLogger()->Error("OpenGL 1.3 or newer is required to use this engine.\n");
|
||||
m_errorMessage = "It seems your graphics card does not support OpenGL 1.3.\n";
|
||||
m_errorMessage += "Please make sure you have appropriate hardware and newest drivers installed.\n";
|
||||
m_errorMessage += "Please make sure you have appropriate hardware and newest drivers installed.\n\n";
|
||||
m_errorMessage += GetHardwareInfo(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -73,6 +73,30 @@ int GetOpenGLVersion()
|
|||
return 10 * major + minor;
|
||||
}
|
||||
|
||||
std::string GetHardwareInfo(bool full)
|
||||
{
|
||||
int glversion = GetOpenGLVersion();
|
||||
|
||||
const char* version = reinterpret_cast<const char*>(glGetString(GL_VERSION));
|
||||
const char* vendor = reinterpret_cast<const char*>(glGetString(GL_VENDOR));
|
||||
const char* renderer = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
|
||||
|
||||
std::string result;
|
||||
|
||||
result += std::string("Hardware information:\n\n");
|
||||
result += "Version:\t" + std::string(version) + '\n';
|
||||
result += "Vendor:\t" + std::string(vendor) + '\n';
|
||||
result += "Renderer:\t" + std::string(renderer) + '\n';
|
||||
|
||||
if (glversion >= 20)
|
||||
{
|
||||
const char* glslVersion = reinterpret_cast<const char*>(glGetString(GL_SHADING_LANGUAGE_VERSION));
|
||||
result += "Shading Language:\t" + std::string(glslVersion) + '\n';
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
GLenum TranslateGfxPrimitive(PrimitiveType type)
|
||||
{
|
||||
GLenum flag = 0;
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include <GL/glew.h>
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
|
||||
|
@ -53,6 +54,9 @@ std::unique_ptr<CDevice> CreateDevice(const DeviceConfig &config, const std::str
|
|||
// First digit is major part, second digit is minor part.
|
||||
int GetOpenGLVersion();
|
||||
|
||||
//! Returns information about graphics card
|
||||
std::string GetHardwareInfo(bool full);
|
||||
|
||||
//! Translate Gfx primitive type to OpenGL primitive type
|
||||
GLenum TranslateGfxPrimitive(PrimitiveType type);
|
||||
|
||||
|
|
Loading…
Reference in New Issue