Handle GL attribList being NULL - use a default attrib list of { 0 }

This commit is contained in:
baldurk
2016-04-02 15:49:22 +02:00
parent 7a513ff965
commit 27696d9c7f
2 changed files with 8 additions and 4 deletions
+4 -2
View File
@@ -629,14 +629,16 @@ void glXDestroyContext(Display *dpy, GLXContext ctx)
__attribute__ ((visibility ("default")))
GLXContext glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config, GLXContext shareList, Bool direct, const int *attribList)
{
const int *attribs = attribList;
int defaultAttribList[] = { 0 };
const int *attribs = attribList ? attribList : defaultAttribList;
vector<int> attribVec;
// modify attribs to our liking
{
bool flagsNext = false;
bool flagsFound = false;
const int *a = attribList;
const int *a = attribs;
while(*a)
{
int val = *a;
+4 -2
View File
@@ -452,14 +452,16 @@ class OpenGLHook : LibraryHook
glhooks.m_CreatingContext = true;
const int *attribs = attribList;
int defaultAttribList[] = { 0 };
const int *attribs = attribList ? attribList : defaultAttribList;
vector<int> attribVec;
// modify attribs to our liking
{
bool flagsNext = false;
bool flagsFound = false;
const int *a = attribList;
const int *a = attribs;
while(*a)
{
int val = *a;