From 202788ffe354274e3eec9caefcbadda40363f5db Mon Sep 17 00:00:00 2001 From: vng Date: Mon, 24 Jan 2011 22:46:39 +0200 Subject: [PATCH] Process errors in getting OpenGL function pointers (windows). --- yg/internal/opengl_win32.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/yg/internal/opengl_win32.cpp b/yg/internal/opengl_win32.cpp index 9df4037b31..c96b277fc3 100644 --- a/yg/internal/opengl_win32.cpp +++ b/yg/internal/opengl_win32.cpp @@ -2,7 +2,7 @@ #include "opengl_win32.hpp" -#include "../../base/assert.hpp" +#include "../../base/logging.hpp" #include "../../base/start_mem_debug.hpp" @@ -34,7 +34,13 @@ namespace win32 template TRet GetGLProc(HMODULE hInst, char const * name) { - return reinterpret_cast(::wglGetProcAddress(name)); + PROC p = ::wglGetProcAddress(name); + if (p == 0) + { + DWORD const err = ::GetLastError(); + LOG(LCRITICAL, ("OpenGL extension function ", name, " not found. Last error = ", err); + } + return reinterpret_cast(p); } void InitOpenGL()