Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
third-party
glew
Commits
2c6ad763
Commit
2c6ad763
authored
Nov 13, 2016
by
Nigel Stewart
Browse files
glxewInit check for current X11 display rather than crashing
parent
7f92f9ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
auto/src/glew_init_glx.c
View file @
2c6ad763
...
...
@@ -14,9 +14,13 @@ GLboolean glxewGetExtension (const char* name)
GLenum
glxewInit
()
{
Display
*
display
;
int
major
,
minor
;
const
GLubyte
*
extStart
;
const
GLubyte
*
extEnd
;
/* check for a display */
display
=
glXGetCurrentDisplay
();
if
(
display
==
NULL
)
return
GLEW_ERROR_NO_GLX_DISPLAY
;
/* initialize core GLX 1.2 */
if
(
_glewInit_GLX_VERSION_1_2
())
return
GLEW_ERROR_GLX_VERSION_11_ONLY
;
/* initialize flags */
...
...
@@ -26,7 +30,7 @@ GLenum glxewInit ()
GLXEW_VERSION_1_3
=
GL_TRUE
;
GLXEW_VERSION_1_4
=
GL_TRUE
;
/* query GLX version */
glXQueryVersion
(
glXGetCurrentD
isplay
()
,
&
major
,
&
minor
);
glXQueryVersion
(
d
isplay
,
&
major
,
&
minor
);
if
(
major
==
1
&&
minor
<=
3
)
{
switch
(
minor
)
...
...
@@ -46,7 +50,7 @@ GLenum glxewInit ()
/* query GLX extension string */
extStart
=
0
;
if
(
glXGetCurrentDisplay
!=
NULL
)
extStart
=
(
const
GLubyte
*
)
glXGetClientString
(
glXGetCurrentD
isplay
()
,
GLX_EXTENSIONS
);
extStart
=
(
const
GLubyte
*
)
glXGetClientString
(
d
isplay
,
GLX_EXTENSIONS
);
if
(
extStart
==
0
)
extStart
=
(
const
GLubyte
*
)
""
;
extEnd
=
extStart
+
_glewStrLen
(
extStart
);
...
...
auto/src/glew_tail.h
View file @
2c6ad763
...
...
@@ -6,6 +6,7 @@
#define GLEW_ERROR_NO_GL_VERSION 1
/* missing GL version */
#define GLEW_ERROR_GL_VERSION_10_ONLY 2
/* Need at least OpenGL 1.1 */
#define GLEW_ERROR_GLX_VERSION_11_ONLY 3
/* Need at least GLX 1.2 */
#define GLEW_ERROR_NO_GLX_DISPLAY 4
/* Need GLX display for GLX support */
/* string codes */
#define GLEW_VERSION 1
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment