Skip to content

Commit

Permalink
Fixed|Windows|libgui: Crash during startup if display driver doesn't …
Browse files Browse the repository at this point in the history
…support OpenGL 2

Entrypoints were null, calls were still being made.

IssueID #2049
  • Loading branch information
skyjake committed May 13, 2015
1 parent 481bc01 commit a73892f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doomsday/libgui/src/canvas.cpp
Expand Up @@ -447,6 +447,9 @@ void Canvas::notifyReady()
void Canvas::paintGL()
{
if(!d->parent || d->parent->isRecreationInProgress()) return;
#ifdef LIBGUI_USE_GLENTRYPOINTS
if(!glBindFramebuffer) return;
#endif

DENG2_ASSERT(QGLContext::currentContext() != 0);

Expand Down
3 changes: 3 additions & 0 deletions doomsday/libgui/src/graphics/glframebuffer.cpp
Expand Up @@ -297,6 +297,9 @@ GLFramebuffer::GLFramebuffer(Image::Format const &colorFormat, Size const &initi
void GLFramebuffer::glInit()
{
if(isReady()) return;
#ifdef LIBGUI_USE_GLENTRYPOINTS
if(!glBindFramebuffer) return;
#endif

LOG_AS("GLFramebuffer");

Expand Down
3 changes: 2 additions & 1 deletion doomsday/libgui/src/graphics/glinfo.cpp
Expand Up @@ -90,7 +90,8 @@ DENG2_PIMPL_NOREF(GLInfo)

#ifdef WIN32
// Prefer the wgl-specific extensions.
if(checkExtensionString(ext, (GLubyte const *) wglGetExtensionsStringARB(wglGetCurrentDC())))
if(wglGetExtensionsStringARB != nullptr &&
checkExtensionString(ext, (GLubyte const *)wglGetExtensionsStringARB(wglGetCurrentDC())))
return true;
#endif

Expand Down
3 changes: 3 additions & 0 deletions doomsday/libgui/src/graphics/glstate.cpp
Expand Up @@ -603,6 +603,9 @@ Rectangleui GLState::scissorRect() const
void GLState::apply() const
{
LIBGUI_ASSERT_GL_OK();
#ifdef LIBGUI_USE_GLENTRYPOINTS
if(!glBindFramebuffer) return;
#endif

bool forceViewportAndScissor = false;

Expand Down
3 changes: 3 additions & 0 deletions doomsday/libgui/src/graphics/gltarget.cpp
Expand Up @@ -507,6 +507,9 @@ void GLTarget::glBind() const
LIBGUI_ASSERT_GL_OK();
DENG2_ASSERT(isReady());
if(!isReady()) return;
#ifdef LIBGUI_USE_GLENTRYPOINTS
if(!glBindFramebuffer) return;
#endif

if(d->proxy)
{
Expand Down

0 comments on commit a73892f

Please sign in to comment.