Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
5ae90a3b
Commit
5ae90a3b
authored
Jul 18, 2010
by
Sam Lantinga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug 1006
Get the GLX functions with glXGetProcAddress() when available.
parent
83d64076
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
16 deletions
+14
-16
SDL_x11opengl.c
src/video/x11/SDL_x11opengl.c
+14
-16
No files found.
src/video/x11/SDL_x11opengl.c
View file @
5ae90a3b
...
@@ -121,28 +121,29 @@ X11_GL_LoadLibrary(_THIS, const char *path)
...
@@ -121,28 +121,29 @@ X11_GL_LoadLibrary(_THIS, const char *path)
/* Load function pointers */
/* Load function pointers */
handle
=
_this
->
gl_config
.
dll_handle
;
handle
=
_this
->
gl_config
.
dll_handle
;
_this
->
gl_data
->
glXGetProcAddress
=
_this
->
gl_data
->
glXGetProcAddress
=
(
void
*
(
*
)(
const
GLubyte
*
))
GL_LoadFunction
(
handle
,
(
void
*
(
*
)(
const
GLubyte
*
))
"glXGetProcAddressARB"
);
GL_LoadFunction
(
handle
,
"glXGetProcAddressARB"
);
_this
->
gl_data
->
glXChooseVisual
=
_this
->
gl_data
->
glXChooseVisual
=
(
XVisualInfo
*
(
*
)(
Display
*
,
int
,
int
*
))
GL_LoadFunction
(
handle
,
(
XVisualInfo
*
(
*
)(
Display
*
,
int
,
int
*
))
"glXChooseVisual"
);
X11_GL_GetProcAddress
(
_this
,
"glXChooseVisual"
);
_this
->
gl_data
->
glXCreateContext
=
_this
->
gl_data
->
glXCreateContext
=
(
GLXContext
(
*
)(
Display
*
,
XVisualInfo
*
,
GLXContext
,
int
))
(
GLXContext
(
*
)(
Display
*
,
XVisualInfo
*
,
GLXContext
,
int
))
GL_LoadFunction
(
handle
,
"glXCreateContext"
);
X11_GL_GetProcAddress
(
_this
,
"glXCreateContext"
);
_this
->
gl_data
->
glXDestroyContext
=
_this
->
gl_data
->
glXDestroyContext
=
(
void
(
*
)(
Display
*
,
GLXContext
))
GL_LoadFunction
(
handle
,
(
void
(
*
)(
Display
*
,
GLXContext
))
"glXDestroyContext"
);
X11_GL_GetProcAddress
(
_this
,
"glXDestroyContext"
);
_this
->
gl_data
->
glXMakeCurrent
=
_this
->
gl_data
->
glXMakeCurrent
=
(
int
(
*
)(
Display
*
,
GLXDrawable
,
GLXContext
))
GL_LoadFunction
(
handle
,
(
int
(
*
)(
Display
*
,
GLXDrawable
,
GLXContext
))
"glXMakeCurrent"
);
X11_GL_GetProcAddress
(
_this
,
"glXMakeCurrent"
);
_this
->
gl_data
->
glXSwapBuffers
=
_this
->
gl_data
->
glXSwapBuffers
=
(
void
(
*
)(
Display
*
,
GLXDrawable
))
GL_LoadFunction
(
handle
,
(
void
(
*
)(
Display
*
,
GLXDrawable
))
"glXSwapBuffers"
);
X11_GL_GetProcAddress
(
_this
,
"glXSwapBuffers"
);
if
(
!
_this
->
gl_data
->
glXChooseVisual
||
if
(
!
_this
->
gl_data
->
glXChooseVisual
||
!
_this
->
gl_data
->
glXCreateContext
||
!
_this
->
gl_data
->
glXCreateContext
||
!
_this
->
gl_data
->
glXDestroyContext
||
!
_this
->
gl_data
->
glXDestroyContext
||
!
_this
->
gl_data
->
glXMakeCurrent
||
!
_this
->
gl_data
->
glXSwapBuffers
)
{
!
_this
->
gl_data
->
glXMakeCurrent
||
!
_this
->
gl_data
->
glXSwapBuffers
)
{
SDL_SetError
(
"Could not retrieve OpenGL functions"
);
SDL_SetError
(
"Could not retrieve OpenGL functions"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -156,13 +157,10 @@ X11_GL_LoadLibrary(_THIS, const char *path)
...
@@ -156,13 +157,10 @@ X11_GL_LoadLibrary(_THIS, const char *path)
void
*
void
*
X11_GL_GetProcAddress
(
_THIS
,
const
char
*
proc
)
X11_GL_GetProcAddress
(
_THIS
,
const
char
*
proc
)
{
{
void
*
handle
;
handle
=
_this
->
gl_config
.
dll_handle
;
if
(
_this
->
gl_data
->
glXGetProcAddress
)
{
if
(
_this
->
gl_data
->
glXGetProcAddress
)
{
return
_this
->
gl_data
->
glXGetProcAddress
((
const
GLubyte
*
)
proc
);
return
_this
->
gl_data
->
glXGetProcAddress
((
const
GLubyte
*
)
proc
);
}
}
return
GL_LoadFunction
(
handle
,
proc
);
return
GL_LoadFunction
(
_this
->
gl_config
.
dll_
handle
,
proc
);
}
}
void
void
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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