From 47bb29bac6b32af32b31db82e33242e69a87287a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 14 Apr 2017 15:32:04 +0200 Subject: [PATCH] - check the return value of ogl_LoadFunctions and abort if it indicates failure. If this happens there is normally something very wrong on the system side so continuing is not advised. --- src/gl/system/gl_framebuffer.cpp | 5 ++++- src/posix/cocoa/i_video.mm | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gl/system/gl_framebuffer.cpp b/src/gl/system/gl_framebuffer.cpp index 24e6ee626..a684f4c4c 100644 --- a/src/gl/system/gl_framebuffer.cpp +++ b/src/gl/system/gl_framebuffer.cpp @@ -120,7 +120,10 @@ void OpenGLFrameBuffer::InitializeState() if (first) { - ogl_LoadFunctions(); + if (ogl_LoadFunctions() == ogl_LOAD_FAILED) + { + I_FatalError("Failed to load OpenGL functions."); + } } gl_LoadExtensions(); diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index 34cb4bb8b..e74161559 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -888,7 +888,10 @@ CocoaFrameBuffer::CocoaFrameBuffer(int width, int height, bool bgra, bool fullsc if (!isOpenGLInitialized) { - ogl_LoadFunctions(); + if (ogl_LoadFunctions() == ogl_LOAD_FAILED) + { + I_FatalError("Failed to load OpenGL functions."); + } isOpenGLInitialized = true; }