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
5d75939b
Commit
5d75939b
authored
Jul 31, 2008
by
Stefan Dösinger
Committed by
Alexandre Julliard
Aug 20, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Keep track of the last used device.
parent
90e2a676
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
context.c
dlls/wined3d/context.c
+13
-1
No files found.
dlls/wined3d/context.c
View file @
5d75939b
...
...
@@ -29,6 +29,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
#define GLINFO_LOCATION This->adapter->gl_info
/* The last used device.
*
* If the application creates multiple devices and switches between them, ActivateContext has to
* change the opengl context. This flag allows to keep track which device is active
*/
static
IWineD3DDeviceImpl
*
last_device
;
/*****************************************************************************
* Context_MarkStateDirty
*
...
...
@@ -562,6 +569,8 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar
*/
if
(
oldDrawable
&&
oldCtx
)
{
pwglMakeCurrent
(
oldDrawable
,
oldCtx
);
}
else
{
last_device
=
This
;
}
This
->
frag_pipe
->
enable_extension
((
IWineD3DDevice
*
)
This
,
TRUE
);
...
...
@@ -627,6 +636,8 @@ void DestroyContext(IWineD3DDeviceImpl *This, WineD3DContext *context) {
TRACE
(
"Destroying ctx %p
\n
"
,
context
);
if
(
pwglGetCurrentContext
()
==
context
->
glCtx
){
pwglMakeCurrent
(
NULL
,
NULL
);
}
else
{
last_device
=
NULL
;
}
if
(
context
->
isPBuffer
)
{
...
...
@@ -1125,7 +1136,7 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU
}
/* Activate the opengl context */
if
(
context
!=
This
->
activeContext
)
{
if
(
last_device
!=
This
||
context
!=
This
->
activeContext
)
{
BOOL
ret
;
/* Prevent an unneeded context switch as those are expensive */
...
...
@@ -1152,6 +1163,7 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU
sizeof
(
*
This
->
activeContext
->
pshader_const_dirty
)
*
GL_LIMITS
(
pshader_constantsF
));
}
This
->
activeContext
=
context
;
last_device
=
This
;
}
/* We only need ENTER_GL for the gl calls made below and for the helper functions which make GL calls */
...
...
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