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
56d1225e
Commit
56d1225e
authored
Jan 29, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 29, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Direct3DCreate8() is always available if we have d3d8.
parent
71d018b2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
57 deletions
+25
-57
Makefile.in
dlls/d3d8/tests/Makefile.in
+1
-1
device.c
dlls/d3d8/tests/device.c
+0
-0
stateblock.c
dlls/d3d8/tests/stateblock.c
+15
-32
visual.c
dlls/d3d8/tests/visual.c
+9
-24
No files found.
dlls/d3d8/tests/Makefile.in
View file @
56d1225e
TESTDLL
=
d3d8.dll
IMPORTS
=
user32
IMPORTS
=
d3d8
user32
C_SRCS
=
\
device.c
\
...
...
dlls/d3d8/tests/device.c
View file @
56d1225e
This diff is collapsed.
Click to expand it.
dlls/d3d8/tests/stateblock.c
View file @
56d1225e
...
...
@@ -33,38 +33,36 @@ static HWND create_window(void)
return
CreateWindowA
(
"d3d8_test_wc"
,
"d3d8_test"
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
}
static
HRESULT
init_d3d8
(
HMODULE
d3d8_module
,
IDirect3DDevice8
**
device
,
D3DPRESENT_PARAMETERS
*
device_pparam
s
)
static
IDirect3DDevice8
*
init_d3d8
(
D3DPRESENT_PARAMETERS
*
present_parameter
s
)
{
IDirect3D
8
*
(
WINAPI
*
d3d8_create
)(
UINT
SDKVersion
)
=
0
;
IDirect3D
Device8
*
device
;
D3DDISPLAYMODE
d3ddm
;
IDirect3D8
*
d3d8
=
0
;
IDirect3D8
*
d3d8
;
HWND
window
;
HRESULT
hr
;
d3d8_create
=
(
void
*
)
GetProcAddress
(
d3d8_module
,
"Direct3DCreate8"
);
if
(
!
d3d8_create
)
return
E_FAIL
;
d3d8
=
d3d8_create
(
D3D_SDK_VERSION
);
if
(
!
d3d8
)
if
(
!
(
d3d8
=
Direct3DCreate8
(
D3D_SDK_VERSION
)))
{
skip
(
"Failed to create D3D8 object.
\n
"
);
return
E_FAI
L
;
return
NUL
L
;
}
window
=
create_window
();
IDirect3D8_GetAdapterDisplayMode
(
d3d8
,
D3DADAPTER_DEFAULT
,
&
d3ddm
);
memset
(
device_pparams
,
0
,
sizeof
(
*
device_pparam
s
));
device_pparam
s
->
Windowed
=
TRUE
;
device_pparam
s
->
SwapEffect
=
D3DSWAPEFFECT_DISCARD
;
device_pparam
s
->
BackBufferFormat
=
d3ddm
.
Format
;
memset
(
present_parameters
,
0
,
sizeof
(
*
present_parameter
s
));
present_parameter
s
->
Windowed
=
TRUE
;
present_parameter
s
->
SwapEffect
=
D3DSWAPEFFECT_DISCARD
;
present_parameter
s
->
BackBufferFormat
=
d3ddm
.
Format
;
hr
=
IDirect3D8_CreateDevice
(
d3d8
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
window
,
D3DCREATE_SOFTWARE_VERTEXPROCESSING
,
device_pparams
,
device
);
D3DCREATE_SOFTWARE_VERTEXPROCESSING
,
present_parameters
,
&
device
);
ok
(
SUCCEEDED
(
hr
)
||
hr
==
D3DERR_NOTAVAILABLE
||
broken
(
hr
==
D3DERR_INVALIDCALL
),
"IDirect3D8_CreateDevice failed, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
return
device
;
return
hr
;
return
NULL
;
}
static
void
test_begin_end_state_block
(
IDirect3DDevice8
*
device
)
...
...
@@ -2048,25 +2046,12 @@ static void test_shader_constant_apply(IDirect3DDevice8 *device)
START_TEST
(
stateblock
)
{
IDirect3DDevice8
*
device
=
NULL
;
D3DPRESENT_PARAMETERS
device_pparams
;
HMODULE
d3d8_modul
e
;
IDirect3DDevice8
*
devic
e
;
ULONG
refcount
;
HRESULT
hr
;
d3d8_module
=
LoadLibraryA
(
"d3d8.dll"
);
if
(
!
d3d8_module
)
{
skip
(
"Could not load d3d8.dll
\n
"
);
return
;
}
hr
=
init_d3d8
(
d3d8_module
,
&
device
,
&
device_pparams
);
if
(
FAILED
(
hr
))
{
FreeLibrary
(
d3d8_module
);
if
(
!
(
device
=
init_d3d8
(
&
device_pparams
)))
return
;
}
test_begin_end_state_block
(
device
);
test_state_management
(
device
,
&
device_pparams
);
...
...
@@ -2074,6 +2059,4 @@ START_TEST(stateblock)
refcount
=
IDirect3DDevice8_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left
\n
"
,
refcount
);
FreeLibrary
(
d3d8_module
);
}
dlls/d3d8/tests/visual.c
View file @
56d1225e
...
...
@@ -23,8 +23,6 @@
#include <d3d8.h>
#include "wine/test.h"
static
HMODULE
d3d8_handle
=
0
;
struct
vec2
{
float
x
,
y
;
...
...
@@ -130,18 +128,12 @@ out:
static
IDirect3DDevice8
*
init_d3d8
(
void
)
{
IDirect3D8
*
(
__stdcall
*
d3d8_create
)(
UINT
SDKVersion
)
=
0
;
IDirect3D8
*
d3d8_ptr
=
0
;
IDirect3DDevice8
*
device_ptr
=
0
;
D3DPRESENT_PARAMETERS
present_parameters
;
IDirect3DDevice8
*
device
=
NULL
;
IDirect3D8
*
d3d8
;
HRESULT
hr
;
d3d8_create
=
(
void
*
)
GetProcAddress
(
d3d8_handle
,
"Direct3DCreate8"
);
ok
(
d3d8_create
!=
NULL
,
"Failed to get address of Direct3DCreate8
\n
"
);
if
(
!
d3d8_create
)
return
NULL
;
d3d8_ptr
=
d3d8_create
(
D3D_SDK_VERSION
);
if
(
!
d3d8_ptr
)
if
(
!
(
d3d8
=
Direct3DCreate8
(
D3D_SDK_VERSION
)))
{
skip
(
"could not create D3D8
\n
"
);
return
NULL
;
...
...
@@ -157,11 +149,12 @@ static IDirect3DDevice8 *init_d3d8(void)
present_parameters
.
EnableAutoDepthStencil
=
TRUE
;
present_parameters
.
AutoDepthStencilFormat
=
D3DFMT_D24S8
;
hr
=
IDirect3D8_CreateDevice
(
d3d8_ptr
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
present_parameters
.
hDeviceWindow
,
D3DCREATE_HARDWARE_VERTEXPROCESSING
,
&
present_parameters
,
&
device_ptr
);
ok
(
hr
==
D3D_OK
||
hr
==
D3DERR_INVALIDCALL
||
broken
(
hr
==
D3DERR_NOTAVAILABLE
),
"IDirect3D_CreateDevice returned: %#08x
\n
"
,
hr
);
hr
=
IDirect3D8_CreateDevice
(
d3d8
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
present_parameters
.
hDeviceWindow
,
D3DCREATE_HARDWARE_VERTEXPROCESSING
,
&
present_parameters
,
&
device
);
ok
(
hr
==
D3D_OK
||
hr
==
D3DERR_INVALIDCALL
||
broken
(
hr
==
D3DERR_NOTAVAILABLE
),
"IDirect3D_CreateDevice returned: %#08x
\n
"
,
hr
);
return
device
_ptr
;
return
device
;
}
struct
vertex
...
...
@@ -4693,15 +4686,7 @@ START_TEST(visual)
DWORD
color
;
D3DCAPS8
caps
;
d3d8_handle
=
LoadLibraryA
(
"d3d8.dll"
);
if
(
!
d3d8_handle
)
{
win_skip
(
"Could not load d3d8.dll
\n
"
);
return
;
}
device_ptr
=
init_d3d8
();
if
(
!
device_ptr
)
if
(
!
(
device_ptr
=
init_d3d8
()))
{
win_skip
(
"Could not initialize direct3d
\n
"
);
return
;
...
...
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