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
b462ff08
Commit
b462ff08
authored
Jun 02, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jul 03, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Create multiple contexts for onscreen render targets.
parent
13f24c38
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
2 deletions
+34
-2
context.c
dlls/wined3d/context.c
+2
-2
swapchain.c
dlls/wined3d/swapchain.c
+30
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/context.c
View file @
b462ff08
...
...
@@ -668,8 +668,8 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU
}
if
(
!
context
)
{
/*
TODO:
Create a new context for the thread */
FIXME
(
"Context creation for a new thread not implemented yet
\n
"
);
/* Create a new context for the thread */
context
=
IWineD3DSwapChainImpl_CreateContextForThread
(
swapchain
);
}
This
->
render_offscreen
=
FALSE
;
/* The context != This->activeContext will catch a NOP context change. This can occur
...
...
dlls/wined3d/swapchain.c
View file @
b462ff08
...
...
@@ -555,3 +555,33 @@ const IWineD3DSwapChainVtbl IWineD3DSwapChain_Vtbl =
IWineD3DSwapChainImpl_SetGammaRamp
,
IWineD3DSwapChainImpl_GetGammaRamp
};
WineD3DContext
*
IWineD3DSwapChainImpl_CreateContextForThread
(
IWineD3DSwapChain
*
iface
)
{
WineD3DContext
*
ctx
;
IWineD3DSwapChainImpl
*
This
=
(
IWineD3DSwapChainImpl
*
)
iface
;
WineD3DContext
**
newArray
;
TRACE
(
"Creating a new context for swapchain %p, thread %d
\n
"
,
This
,
GetCurrentThreadId
());
ctx
=
CreateContext
(
This
->
wineD3DDevice
,
(
IWineD3DSurfaceImpl
*
)
This
->
frontBuffer
,
This
->
context
[
0
]
->
display
,
This
->
win
);
if
(
!
ctx
)
{
ERR
(
"Failed to create a new context for the swapchain
\n
"
);
return
NULL
;
}
newArray
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
newArray
)
*
This
->
num_contexts
+
1
);
if
(
!
newArray
)
{
ERR
(
"Out of memory when trying to allocate a new context array
\n
"
);
DestroyContext
(
This
->
wineD3DDevice
,
ctx
);
return
NULL
;
}
memcpy
(
newArray
,
This
->
context
,
sizeof
(
*
newArray
)
*
This
->
num_contexts
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
context
);
newArray
[
This
->
num_contexts
]
=
ctx
;
This
->
context
=
newArray
;
This
->
num_contexts
++
;
TRACE
(
"Returning context %p
\n
"
,
ctx
);
return
ctx
;
}
dlls/wined3d/wined3d_private.h
View file @
b462ff08
...
...
@@ -1412,6 +1412,8 @@ typedef struct IWineD3DSwapChainImpl
extern
const
IWineD3DSwapChainVtbl
IWineD3DSwapChain_Vtbl
;
WineD3DContext
*
IWineD3DSwapChainImpl_CreateContextForThread
(
IWineD3DSwapChain
*
iface
);
/*****************************************************************************
* Utility function prototypes
*/
...
...
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