Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5a4c15b9
Commit
5a4c15b9
authored
May 03, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
May 03, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Add a separate function for d3d8 initialization.
parent
0f9ccac4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
30 deletions
+33
-30
d3d8_main.c
dlls/d3d8/d3d8_main.c
+16
-16
d3d8_private.h
dlls/d3d8/d3d8_private.h
+2
-13
directx.c
dlls/d3d8/directx.c
+15
-1
No files found.
dlls/d3d8/d3d8_main.c
View file @
5a4c15b9
...
...
@@ -35,27 +35,27 @@ void WINAPI DebugSetMute(void) {
/* nothing to do */
}
IDirect3D8
*
WINAPI
DECLSPEC_HOTPATCH
Direct3DCreate8
(
UINT
SDKVersion
)
{
IDirect3D8Impl
*
object
;
TRACE
(
"SDKVersion = %x
\n
"
,
SDKVersion
);
wined3d_mutex_lock
();
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirect3D8Impl
));
object
->
IDirect3D8_iface
.
lpVtbl
=
&
Direct3D8_Vtbl
;
object
->
ref
=
1
;
object
->
WineD3D
=
wined3d_create
(
8
,
WINED3D_LEGACY_DEPTH_BIAS
);
IDirect3D8
*
WINAPI
DECLSPEC_HOTPATCH
Direct3DCreate8
(
UINT
sdk_version
)
{
IDirect3D8Impl
*
object
;
TRACE
(
"
Created Direct3D object @ %p, WineObj @ %p
\n
"
,
object
,
object
->
WineD3D
);
TRACE
(
"
sdk_version %#x.
\n
"
,
sdk_version
);
wined3d_mutex_unlock
();
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
{
ERR
(
"Failed to allocate d3d8 object memory.
\n
"
);
return
NULL
;
}
if
(
!
object
->
WineD3D
)
if
(
!
d3d8_init
(
object
)
)
{
HeapFree
(
GetProcessHeap
(),
0
,
object
);
object
=
NULL
;
WARN
(
"Failed to initialize d3d8.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
NULL
;
}
TRACE
(
"Created d3d8 object %p.
\n
"
,
object
);
return
&
object
->
IDirect3D8_iface
;
}
...
...
dlls/d3d8/d3d8_private.h
View file @
5a4c15b9
...
...
@@ -110,19 +110,6 @@ typedef struct IDirect3DSwapChain8Impl IDirect3DSwapChain8Impl;
typedef
struct
IDirect3DVolume8Impl
IDirect3DVolume8Impl
;
typedef
struct
IDirect3DVertexBuffer8Impl
IDirect3DVertexBuffer8Impl
;
/* ===========================================================================
The interfaces themselves
=========================================================================== */
/* ---------- */
/* IDirect3D8 */
/* ---------- */
/*****************************************************************************
* Predeclare the interface implementation structures
*/
extern
const
IDirect3D8Vtbl
Direct3D8_Vtbl
DECLSPEC_HIDDEN
;
/*****************************************************************************
* IDirect3D implementation structure
*/
...
...
@@ -133,6 +120,8 @@ struct IDirect3D8Impl
struct
wined3d
*
WineD3D
;
};
BOOL
d3d8_init
(
IDirect3D8Impl
*
d3d8
)
DECLSPEC_HIDDEN
;
/*****************************************************************************
* IDirect3DDevice8 implementation structure
*/
...
...
dlls/d3d8/directx.c
View file @
5a4c15b9
...
...
@@ -378,7 +378,7 @@ static HRESULT WINAPI IDirect3D8Impl_CreateDevice(IDirect3D8 *iface, UINT adapte
return
D3D_OK
;
}
cons
t
IDirect3D8Vtbl
Direct3D8_Vtbl
=
static
const
struc
t
IDirect3D8Vtbl
Direct3D8_Vtbl
=
{
/* IUnknown */
IDirect3D8Impl_QueryInterface
,
...
...
@@ -399,3 +399,17 @@ const IDirect3D8Vtbl Direct3D8_Vtbl =
IDirect3D8Impl_GetAdapterMonitor
,
IDirect3D8Impl_CreateDevice
};
BOOL
d3d8_init
(
IDirect3D8Impl
*
d3d8
)
{
d3d8
->
IDirect3D8_iface
.
lpVtbl
=
&
Direct3D8_Vtbl
;
d3d8
->
ref
=
1
;
wined3d_mutex_lock
();
d3d8
->
WineD3D
=
wined3d_create
(
8
,
WINED3D_LEGACY_DEPTH_BIAS
);
wined3d_mutex_unlock
();
if
(
!
d3d8
->
WineD3D
)
return
FALSE
;
return
TRUE
;
}
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