mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-22 10:17:22 +00:00
GRAPHICS: Handle cases where glGetString returns a nullptr
This commit is contained in:
parent
528378a560
commit
6bbcd95c10
@ -104,7 +104,10 @@ void Context::initialize(ContextType contextType) {
|
||||
|
||||
const char *verString = (const char *)glGetString(GL_VERSION);
|
||||
|
||||
if (type == kContextGL) {
|
||||
if (!verString) {
|
||||
majorVersion = minorVersion = 0;
|
||||
warning("Could not parse fetch GL_VERSION: %d", glGetError());
|
||||
} else if (type == kContextGL) {
|
||||
// OpenGL version number is either of the form major.minor or major.minor.release,
|
||||
// where the numbers all have one or more digits
|
||||
if (sscanf(verString, "%d.%d", &majorVersion, &minorVersion) != 2) {
|
||||
@ -141,6 +144,9 @@ void Context::initialize(ContextType contextType) {
|
||||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint *)&maxTextureSize);
|
||||
|
||||
const char *extString = (const char *)glGetString(GL_EXTENSIONS);
|
||||
if (!extString) {
|
||||
extString = "";
|
||||
}
|
||||
|
||||
bool ARBShaderObjects = false;
|
||||
bool ARBShadingLanguage100 = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user