From a9591f57a64f45bad73d514018e373812631118d Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Fri, 7 Apr 2017 03:03:21 +0200 Subject: [PATCH] - Detect dinosaur OpenGL and refuse to use it --- src/gl/system/gl_swframebuffer.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/gl/system/gl_swframebuffer.cpp b/src/gl/system/gl_swframebuffer.cpp index 16138585d..b3de63eee 100644 --- a/src/gl/system/gl_swframebuffer.cpp +++ b/src/gl/system/gl_swframebuffer.cpp @@ -200,6 +200,19 @@ OpenGLSWFrameBuffer::OpenGLSWFrameBuffer(void *hMonitor, int width, int height, return; } } + + const char *glversion = (const char*)glGetString(GL_VERSION); + bool isGLES = (glversion && strlen(glversion) > 10 && memcmp(glversion, "OpenGL ES ", 10) == 0); + if (isGLES && ogl_IsVersionGEQ(2, 0) == 0) + { + Printf("OpenGL acceleration requires at least OpenGL ES 2.0. No Acceleration will be used.\n"); + return; + } + else if (!isGLES && ogl_IsVersionGEQ(3, 0) == 0) + { + Printf("OpenGL acceleration requires at least OpenGL 3.0. No Acceleration will be used.\n"); + return; + } gl_LoadExtensions(); InitializeState(); if (first)