Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
253a2d08
Commit
253a2d08
authored
Mar 20, 2006
by
Mike Hearn
Committed by
Alexandre Julliard
Mar 21, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opengl32: Optimize thunks by storing GL context in the thread environment block.
parent
e6f16250
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
13 deletions
+16
-13
Makefile.in
dlls/opengl32/Makefile.in
+1
-1
wgl.c
dlls/opengl32/wgl.c
+15
-12
No files found.
dlls/opengl32/Makefile.in
View file @
253a2d08
...
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
opengl32.dll
IMPORTLIB
=
libopengl32.
$(IMPLIBEXT)
IMPORTS
=
user32 gdi32 advapi32 kernel32
IMPORTS
=
user32 gdi32 advapi32 kernel32
ntdll
EXTRAINCL
=
@X_CFLAGS@
EXTRALIBS
=
@X_LIBS@ @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@ @OPENGL_LIBS@
...
...
dlls/opengl32/wgl.c
View file @
253a2d08
...
...
@@ -31,6 +31,8 @@
#include "winerror.h"
#include "winreg.h"
#include "wingdi.h"
#include "winternl.h"
#include "winnt.h"
#include "wgl_ext.h"
#include "opengl_ext.h"
...
...
@@ -82,6 +84,7 @@ typedef struct wine_glcontext {
XVisualInfo
*
vis
;
GLXFBConfig
fb_conf
;
GLXContext
ctx
;
BOOL
do_escape
;
struct
wine_glcontext
*
next
;
struct
wine_glcontext
*
prev
;
}
Wine_GLContext
;
...
...
@@ -96,18 +99,13 @@ static inline Wine_GLContext *get_context_from_GLXContext(GLXContext ctx)
void
enter_gl
(
void
)
{
GLXContext
gl_ctx
;
Wine_GLContext
*
ctx
;
enum
x11drv_escape_codes
escape
=
X11DRV_SYNC_PIXMAP
;
wine_tsx11_lock_ptr
();
gl_ctx
=
glXGetCurrentContext
();
if
(
!
gl_ctx
)
return
;
ctx
=
get_context_from_GLXContext
(
gl_ctx
);
wine_tsx11_unlock_ptr
();
/* unlock before calling GDI apis */
if
(
ctx
&&
GetObjectType
(
ctx
->
hdc
)
==
OBJ_MEMDC
)
ExtEscape
(
ctx
->
hdc
,
X11DRV_ESCAPE
,
sizeof
(
escape
),
(
LPCSTR
)
&
escape
,
0
,
NULL
);
Wine_GLContext
*
curctx
=
(
Wine_GLContext
*
)
NtCurrentTeb
()
->
glContext
;
if
(
curctx
&&
curctx
->
do_escape
)
{
enum
x11drv_escape_codes
escape
=
X11DRV_SYNC_PIXMAP
;
ExtEscape
(
curctx
->
hdc
,
X11DRV_ESCAPE
,
sizeof
(
escape
),
(
LPCSTR
)
&
escape
,
0
,
NULL
);
}
wine_tsx11_lock_ptr
();
return
;
...
...
@@ -541,6 +539,7 @@ BOOL WINAPI wglMakeCurrent(HDC hdc,
ENTER_GL
();
if
(
hglrc
==
NULL
)
{
ret
=
glXMakeCurrent
(
default_display
,
None
,
NULL
);
NtCurrentTeb
()
->
glContext
=
NULL
;
}
else
{
Wine_GLContext
*
ctx
=
(
Wine_GLContext
*
)
hglrc
;
Drawable
drawable
=
get_drawable
(
hdc
);
...
...
@@ -571,8 +570,12 @@ BOOL WINAPI wglMakeCurrent(HDC hdc,
}
TRACE
(
" make current for dis %p, drawable %p, ctx %p
\n
"
,
ctx
->
display
,
(
void
*
)
drawable
,
ctx
->
ctx
);
ret
=
glXMakeCurrent
(
ctx
->
display
,
drawable
,
ctx
->
ctx
);
NtCurrentTeb
()
->
glContext
=
ctx
;
if
(
ret
&&
type
==
OBJ_MEMDC
)
{
ctx
->
do_escape
=
TRUE
;
glDrawBuffer
(
GL_FRONT_LEFT
);
}
}
LEAVE_GL
();
TRACE
(
" returning %s
\n
"
,
(
ret
?
"True"
:
"False"
));
...
...
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