mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
Added OpenGL vendor and renderer string checks to warn if the application is being run using a non-accelerated OpenGL context.
This commit is contained in:
parent
db8c237f6a
commit
e0d27358fb
@ -473,6 +473,19 @@ void GlContext::checkSettings(const ContextSettings& requestedSettings)
|
||||
{
|
||||
// Perform checks to inform the user if they are getting a context they might not have expected
|
||||
|
||||
// Detect any known non-accelerated implementations and warn
|
||||
const char* vendorName = reinterpret_cast<const char*>(glGetString(GL_VENDOR));
|
||||
const char* rendererName = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
|
||||
|
||||
if (vendorName && rendererName)
|
||||
{
|
||||
if ((std::strcmp(vendorName, "Microsoft Corporation") == 0) && (std::strcmp(rendererName, "GDI Generic") == 0))
|
||||
{
|
||||
err() << "Warning: Detected \"Microsoft Corporation GDI Generic\" OpenGL implementation" << std::endl
|
||||
<< "The current OpenGL implementation is not hardware-accelerated" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
int version = m_settings.majorVersion * 10 + m_settings.minorVersion;
|
||||
int requestedVersion = requestedSettings.majorVersion * 10 + requestedSettings.minorVersion;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user