diff --git a/glbind.h b/glbind.h index 36cff29..dae5f02 100644 --- a/glbind.h +++ b/glbind.h @@ -1,6 +1,6 @@ /* OpenGL API loader. Choice of public domain or MIT-0. See license statements at the end of this file. -glbind - v4.6.8 - 2020-04-13 +glbind - v4.6.9 - 2020-05-11 David Reid - davidreidsoftware@gmail.com */ @@ -20110,10 +20110,14 @@ GLenum glbInit(GLBapi* pAPI, GLBconfig* pConfig) /* Here is where we need to initialize our dummy objects so we can get a context and retrieve some API pointers. */ #if defined(GLBIND_WGL) { - HWND hWnd = pConfig->hWnd; + HWND hWnd = NULL; + + if (pConfig != NULL) { + hWnd = pConfig->hWnd; + } /* Create a dummy window if we haven't passed in an explicit window. */ - if (pConfig->hWnd == 0) { + if (hWnd == NULL) { WNDCLASSEXW dummyWC; memset(&dummyWC, 0, sizeof(dummyWC)); dummyWC.cbSize = sizeof(dummyWC); diff --git a/source/glbind_template.h b/source/glbind_template.h index 41b1290..3546c6a 100644 --- a/source/glbind_template.h +++ b/source/glbind_template.h @@ -559,10 +559,14 @@ GLenum glbInit(GLBapi* pAPI, GLBconfig* pConfig) /* Here is where we need to initialize our dummy objects so we can get a context and retrieve some API pointers. */ #if defined(GLBIND_WGL) { - HWND hWnd = pConfig->hWnd; + HWND hWnd = NULL; + + if (pConfig != NULL) { + hWnd = pConfig->hWnd; + } /* Create a dummy window if we haven't passed in an explicit window. */ - if (pConfig->hWnd == 0) { + if (hWnd == NULL) { WNDCLASSEXW dummyWC; memset(&dummyWC, 0, sizeof(dummyWC)); dummyWC.cbSize = sizeof(dummyWC);