Skip to content

Commit

Permalink
libgui|Windows|Linux: Report missing OpenGL entry points
Browse files Browse the repository at this point in the history
Exception thrown, aborts startup.

IssueID #1977
  • Loading branch information
skyjake committed Sep 5, 2015
1 parent d6df20d commit ea1d417
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doomsday/apps/client/src/clientapp.cpp
Expand Up @@ -87,6 +87,8 @@ static void handleLegacyCoreTerminate(char const *msg)

static void continueInitWithEventLoopRunning()
{
if(!ClientWindowSystem::mainExists()) return;

// Show the main window. This causes initialization to finish (in busy mode)
// as the canvas is visible and ready for initialization.
ClientWindowSystem::main().show();
Expand Down
9 changes: 8 additions & 1 deletion doomsday/sdk/libgui/src/graphics/glentrypoints.cpp
Expand Up @@ -117,6 +117,12 @@ PFNGLVERTEXATTRIBDIVISORARBPROC glVertexAttribDivisorARB;
PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC glRenderbufferStorageMultisampleCoverageNV;
#endif

static void reportMissingEntryPoint(char const *name)
{
throw de::Error("getAllOpenGLEntryPoints",
QString("Required OpenGL function missing: %1").arg(name));
}

void getAllOpenGLEntryPoints()
{
static bool haveProcs = false;
Expand All @@ -132,7 +138,8 @@ void getAllOpenGLEntryPoints()
# define GET_PROC_EXT(name) *((void (**)())&name) = glXGetProcAddress((GLubyte const *)#name)
#endif

#define GET_PROC(name) GET_PROC_EXT(name); DENG2_ASSERT(name != 0) // must have
#define GET_PROC(name) GET_PROC_EXT(name); DENG2_ASSERT(name != 0); \
if(!name) { reportMissingEntryPoint(#name); } // must have

#ifdef LIBGUI_FETCH_GL_1_3
GET_PROC(glActiveTexture);
Expand Down

0 comments on commit ea1d417

Please sign in to comment.