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
5b2d1710
Commit
5b2d1710
authored
May 25, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
May 25, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Add a separate function for d3d9 initialization.
parent
372984e0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
38 deletions
+52
-38
d3d9_main.c
dlls/d3d9/d3d9_main.c
+35
-23
d3d9_private.h
dlls/d3d9/d3d9_private.h
+1
-13
directx.c
dlls/d3d9/directx.c
+16
-2
No files found.
dlls/d3d9/d3d9_main.c
View file @
5b2d1710
...
...
@@ -33,40 +33,52 @@ void WINAPI DebugSetMute(void) {
/* nothing to do */
}
IDirect3D9
*
WINAPI
DECLSPEC_HOTPATCH
Direct3DCreate9
(
UINT
SDKVersion
)
{
IDirect3D9Impl
*
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirect3D9Impl
));
object
->
IDirect3D9Ex_iface
.
lpVtbl
=
&
Direct3D9_Vtbl
;
object
->
ref
=
1
;
IDirect3D9
*
WINAPI
DECLSPEC_HOTPATCH
Direct3DCreate9
(
UINT
sdk_version
)
{
IDirect3D9Impl
*
object
;
wined3d_mutex_lock
();
object
->
WineD3D
=
wined3d_create
(
9
,
0
);
wined3d_mutex_unlock
();
TRACE
(
"sdk_version %#x.
\n
"
,
sdk_version
);
TRACE
(
"SDKVersion = %x, Created Direct3D object @ %p, WineObj @ %p
\n
"
,
SDKVersion
,
object
,
object
->
WineD3D
);
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
{
ERR
(
"Failed to allocate d3d9 object memory.
\n
"
);
return
NULL
;
}
if
(
!
object
->
WineD3D
)
if
(
!
d3d9_init
(
object
,
FALSE
)
)
{
HeapFree
(
GetProcessHeap
(),
0
,
object
);
object
=
NULL
;
WARN
(
"Failed to initialize d3d9.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
NULL
;
}
return
(
IDirect3D9
*
)
object
;
TRACE
(
"Created d3d9 object %p.
\n
"
,
object
);
return
(
IDirect3D9
*
)
&
object
->
IDirect3D9Ex_iface
;
}
HRESULT
WINAPI
DECLSPEC_HOTPATCH
Direct3DCreate9Ex
(
UINT
SDKVersion
,
IDirect3D9Ex
**
direct3d9ex
)
{
IDirect3D9
*
ret
;
IDirect3D9Impl
*
object
;
HRESULT
WINAPI
DECLSPEC_HOTPATCH
Direct3DCreate9Ex
(
UINT
sdk_version
,
IDirect3D9Ex
**
d3d9ex
)
{
IDirect3D9Impl
*
object
;
TRACE
(
"Calling Direct3DCreate9
\n
"
);
ret
=
Direct3DCreate9
(
SDKVersion
);
if
(
!
ret
)
{
*
direct3d9ex
=
NULL
;
TRACE
(
"sdk_version %#x, d3d9ex %p.
\n
"
,
sdk_version
,
d3d9ex
);
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
{
ERR
(
"Failed to allocate d3d9 object memory.
\n
"
);
return
E_OUTOFMEMORY
;
}
if
(
!
d3d9_init
(
object
,
TRUE
))
{
WARN
(
"Failed to initialize d3d9.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
D3DERR_NOTAVAILABLE
;
}
object
=
(
IDirect3D9Impl
*
)
ret
;
object
->
extended
=
TRUE
;
/* Enables QI for extended interfaces */
*
direct3d9ex
=
&
object
->
IDirect3D9Ex_iface
;
TRACE
(
"Created d3d9 object %p.
\n
"
,
object
)
;
*
d3d9ex
=
&
object
->
IDirect3D9Ex_iface
;
return
D3D_OK
;
}
...
...
dlls/d3d9/d3d9_private.h
View file @
5b2d1710
...
...
@@ -127,19 +127,6 @@ enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_H
_pD3D9Caps->MaxVertexShader30InstructionSlots = _pWineCaps->MaxVertexShader30InstructionSlots; \
_pD3D9Caps->MaxPixelShader30InstructionSlots = _pWineCaps->MaxPixelShader30InstructionSlots;
/* ===========================================================================
D3D9 interfaces
=========================================================================== */
/* ---------- */
/* IDirect3D9 */
/* ---------- */
/*****************************************************************************
* Predeclare the interface implementation structures
*/
extern
const
IDirect3D9ExVtbl
Direct3D9_Vtbl
DECLSPEC_HIDDEN
;
/*****************************************************************************
* IDirect3D implementation structure
*/
...
...
@@ -155,6 +142,7 @@ typedef struct IDirect3D9Impl
BOOL
extended
;
}
IDirect3D9Impl
;
BOOL
d3d9_init
(
IDirect3D9Impl
*
d3d9
,
BOOL
extended
)
DECLSPEC_HIDDEN
;
void
filter_caps
(
D3DCAPS9
*
pCaps
)
DECLSPEC_HIDDEN
;
struct
fvf_declaration
...
...
dlls/d3d9/directx.c
View file @
5b2d1710
...
...
@@ -551,8 +551,7 @@ static HRESULT WINAPI IDirect3D9ExImpl_GetAdapterLUID(IDirect3D9Ex *iface, UINT
return
hr
;
}
const
IDirect3D9ExVtbl
Direct3D9_Vtbl
=
static
const
struct
IDirect3D9ExVtbl
Direct3D9_Vtbl
=
{
/* IUnknown */
IDirect3D9Impl_QueryInterface
,
...
...
@@ -581,3 +580,18 @@ const IDirect3D9ExVtbl Direct3D9_Vtbl =
IDirect3D9ExImpl_GetAdapterLUID
};
BOOL
d3d9_init
(
IDirect3D9Impl
*
d3d9
,
BOOL
extended
)
{
d3d9
->
IDirect3D9Ex_iface
.
lpVtbl
=
&
Direct3D9_Vtbl
;
d3d9
->
ref
=
1
;
wined3d_mutex_lock
();
d3d9
->
WineD3D
=
wined3d_create
(
9
,
0
);
wined3d_mutex_unlock
();
if
(
!
d3d9
->
WineD3D
)
return
FALSE
;
d3d9
->
extended
=
extended
;
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