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
a1b96349
Commit
a1b96349
authored
Jan 29, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 29, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Direct3DCreate9() is always available if we have d3d9.
parent
56d1225e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
103 deletions
+46
-103
Makefile.in
dlls/d3d9/tests/Makefile.in
+1
-1
d3d9ex.c
dlls/d3d9/tests/d3d9ex.c
+1
-7
device.c
dlls/d3d9/tests/device.c
+0
-0
stateblock.c
dlls/d3d9/tests/stateblock.c
+24
-39
vertexdeclaration.c
dlls/d3d9/tests/vertexdeclaration.c
+14
-34
visual.c
dlls/d3d9/tests/visual.c
+6
-22
No files found.
dlls/d3d9/tests/Makefile.in
View file @
a1b96349
TESTDLL
=
d3d9.dll
IMPORTS
=
user32 gdi32
IMPORTS
=
d3d9
user32 gdi32
C_SRCS
=
\
d3d9ex.c
\
...
...
dlls/d3d9/tests/d3d9ex.c
View file @
a1b96349
...
...
@@ -35,7 +35,6 @@ static BOOL (WINAPI *pEnumDisplaySettingsExA)(const char *device_name,
static
LONG
(
WINAPI
*
pChangeDisplaySettingsExA
)(
const
char
*
device_name
,
DEVMODEA
*
mode
,
HWND
window
,
DWORD
flags
,
void
*
param
);
static
IDirect3D9
*
(
WINAPI
*
pDirect3DCreate9
)(
UINT
SDKVersion
);
static
HRESULT
(
WINAPI
*
pDirect3DCreate9Ex
)(
UINT
SDKVersion
,
IDirect3D9Ex
**
d3d9ex
);
static
HWND
create_window
(
void
)
...
...
@@ -117,7 +116,7 @@ static ULONG getref(IUnknown *obj) {
static
void
test_qi_base_to_ex
(
void
)
{
IDirect3D9
*
d3d9
=
p
Direct3DCreate9
(
D3D_SDK_VERSION
);
IDirect3D9
*
d3d9
=
Direct3DCreate9
(
D3D_SDK_VERSION
);
IDirect3D9Ex
*
d3d9ex
=
(
void
*
)
0xdeadbeef
;
IDirect3DDevice9
*
device
;
IDirect3DDevice9Ex
*
deviceEx
=
(
void
*
)
0xdeadbeef
;
...
...
@@ -1203,11 +1202,6 @@ START_TEST(d3d9ex)
skip
(
"Could not load d3d9.dll
\n
"
);
return
;
}
pDirect3DCreate9
=
(
void
*
)
GetProcAddress
(
d3d9_handle
,
"Direct3DCreate9"
);
ok
(
pDirect3DCreate9
!=
NULL
,
"Failed to get address of Direct3DCreate9
\n
"
);
if
(
!
pDirect3DCreate9
)
{
return
;
}
pDirect3DCreate9Ex
=
(
void
*
)
GetProcAddress
(
d3d9_handle
,
"Direct3DCreate9Ex"
);
if
(
!
pDirect3DCreate9Ex
)
{
...
...
dlls/d3d9/tests/device.c
View file @
a1b96349
This diff is collapsed.
Click to expand it.
dlls/d3d9/tests/stateblock.c
View file @
a1b96349
...
...
@@ -21,8 +21,6 @@
#include <d3d9.h>
#include "wine/test.h"
static
HMODULE
d3d9_handle
=
0
;
static
DWORD
texture_stages
;
static
HWND
create_window
(
void
)
...
...
@@ -36,38 +34,33 @@ static HWND create_window(void)
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
}
static
HRESULT
init_d3d9
(
IDirect3DDevice9
**
device
,
D3DPRESENT_PARAMETERS
*
device_pparams
)
static
IDirect3DDevice9
*
init_d3d9
(
D3DPRESENT_PARAMETERS
*
present_parameters
)
{
IDirect3D9
*
(
__stdcall
*
d3d9_create
)(
UINT
SDKVersion
)
=
0
;
IDirect3D9
*
d3d9_ptr
=
0
;
HRESULT
hres
;
IDirect3DDevice9
*
device
;
IDirect3D9
*
d3d9
;
HWND
window
;
HRESULT
hr
;
d3d9_create
=
(
void
*
)
GetProcAddress
(
d3d9_handle
,
"Direct3DCreate9"
);
ok
(
d3d9_create
!=
NULL
,
"Failed to get address of Direct3DCreate9
\n
"
);
if
(
!
d3d9_create
)
return
E_FAIL
;
d3d9_ptr
=
d3d9_create
(
D3D_SDK_VERSION
);
if
(
!
d3d9_ptr
)
if
(
!
(
d3d9
=
Direct3DCreate9
(
D3D_SDK_VERSION
)))
{
skip
(
"could not create D3D9
\n
"
);
return
E_FAI
L
;
return
NUL
L
;
}
window
=
create_window
();
ZeroMemory
(
device_pparams
,
sizeof
(
D3DPRESENT_PARAMETERS
));
device_pparam
s
->
Windowed
=
TRUE
;
device_pparam
s
->
hDeviceWindow
=
window
;
device_pparam
s
->
SwapEffect
=
D3DSWAPEFFECT_DISCARD
;
memset
(
present_parameters
,
0
,
sizeof
(
*
present_parameters
));
present_parameter
s
->
Windowed
=
TRUE
;
present_parameter
s
->
hDeviceWindow
=
window
;
present_parameter
s
->
SwapEffect
=
D3DSWAPEFFECT_DISCARD
;
hres
=
IDirect3D9_CreateDevice
(
d3d9_ptr
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
window
,
D3DCREATE_SOFTWARE_VERTEXPROCESSING
,
device_pparams
,
device
);
ok
(
hres
==
D3D_OK
||
hres
==
D3DERR_NOTAVAILABLE
,
"IDirect3D_CreateDevice returned: 0x%x
\n
"
,
hres
);
return
hres
;
hr
=
IDirect3D9_CreateDevice
(
d3d9
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
window
,
D3DCREATE_SOFTWARE_VERTEXPROCESSING
,
present_parameters
,
&
device
);
ok
(
hr
==
D3D_OK
||
hr
==
D3DERR_NOTAVAILABLE
,
"Failed to create device, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
return
device
;
return
NULL
;
}
static
void
test_begin_end_state_block
(
IDirect3DDevice9
*
device_ptr
)
...
...
@@ -2441,26 +2434,18 @@ static void test_vdecl_apply(IDirect3DDevice9 *device)
START_TEST
(
stateblock
)
{
IDirect3DDevice9
*
device_ptr
=
NULL
;
D3DPRESENT_PARAMETERS
device_pparams
;
HRESULT
hret
;
IDirect3DDevice9
*
device
;
ULONG
refcount
;
d3d9_handle
=
LoadLibraryA
(
"d3d9.dll"
);
if
(
!
d3d9_handle
)
{
skip
(
"Could not load d3d9.dll
\n
"
);
if
(
!
(
device
=
init_d3d9
(
&
device_pparams
)))
return
;
}
hret
=
init_d3d9
(
&
device_ptr
,
&
device_pparams
);
if
(
hret
!=
D3D_OK
)
return
;
test_begin_end_state_block
(
device
_ptr
);
test_state_management
(
device
_ptr
,
&
device_pparams
);
test_shader_constant_apply
(
device
_ptr
);
test_vdecl_apply
(
device
_ptr
);
test_begin_end_state_block
(
device
);
test_state_management
(
device
,
&
device_pparams
);
test_shader_constant_apply
(
device
);
test_vdecl_apply
(
device
);
refcount
=
IDirect3DDevice9_Release
(
device
_ptr
);
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left
\n
"
,
refcount
);
}
dlls/d3d9/tests/vertexdeclaration.c
View file @
a1b96349
...
...
@@ -21,8 +21,6 @@
#include <d3d9.h>
#include "wine/test.h"
static
HMODULE
d3d9_handle
=
0
;
#define VDECL_CHECK(fcall) \
if(fcall != S_OK) \
trace(" Test failed on line #%d\n", __LINE__);
...
...
@@ -40,41 +38,31 @@ static HWND create_window(void)
static
IDirect3DDevice9
*
init_d3d9
(
void
)
{
IDirect3D9
*
(
__stdcall
*
d3d9_create
)(
UINT
SDKVersion
)
=
0
;
IDirect3D9
*
d3d9_ptr
=
0
;
IDirect3DDevice9
*
device_ptr
=
0
;
D3DPRESENT_PARAMETERS
present_parameters
;
HRESULT
hres
;
d3d9_create
=
(
void
*
)
GetProcAddress
(
d3d9_handle
,
"Direct3DCreate9"
);
ok
(
d3d9_create
!=
NULL
,
"Failed to get address of Direct3DCreate9
\n
"
);
if
(
!
d3d9_create
)
return
NULL
;
IDirect3DDevice9
*
device
=
NULL
;
IDirect3D9
*
d3d9
;
HRESULT
hr
;
d3d9_ptr
=
d3d9_create
(
D3D_SDK_VERSION
);
if
(
!
d3d9_ptr
)
if
(
!
(
d3d9
=
Direct3DCreate9
(
D3D_SDK_VERSION
)))
{
skip
(
"could not create D3D9
\n
"
);
return
NULL
;
}
ZeroMemory
(
&
present_parameters
,
sizeof
(
present_parameters
));
memset
(
&
present_parameters
,
0
,
sizeof
(
present_parameters
));
present_parameters
.
Windowed
=
TRUE
;
present_parameters
.
hDeviceWindow
=
create_window
();
present_parameters
.
SwapEffect
=
D3DSWAPEFFECT_DISCARD
;
hres
=
IDirect3D9_CreateDevice
(
d3d9_ptr
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
NULL
,
D3DCREATE_SOFTWARE_VERTEXPROCESSING
,
&
present_parameters
,
&
device_ptr
);
if
(
SUCCEEDED
(
IDirect3D9_CreateDevice
(
d3d9
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
NULL
,
D3DCREATE_SOFTWARE_VERTEXPROCESSING
,
&
present_parameters
,
&
device
)))
return
device
;
if
(
SUCCEEDED
(
hr
=
IDirect3D9_CreateDevice
(
d3d9
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_REF
,
NULL
,
D3DCREATE_SOFTWARE_VERTEXPROCESSING
,
&
present_parameters
,
&
device
)))
return
device
;
if
(
FAILED
(
hres
))
{
hres
=
IDirect3D9_CreateDevice
(
d3d9_ptr
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_REF
,
NULL
,
D3DCREATE_SOFTWARE_VERTEXPROCESSING
,
&
present_parameters
,
&
device_ptr
);
if
(
FAILED
(
hres
))
{
trace
(
"could not create device, IDirect3D9_CreateDevice returned %#x
\n
"
,
hres
);
return
NULL
;
}
}
return
device_ptr
;
trace
(
"Failed to create device, hr %#x.
\n
"
,
hr
);
return
NULL
;
}
static
int
get_refcount
(
IUnknown
*
object
)
...
...
@@ -851,15 +839,7 @@ START_TEST(vertexdeclaration)
IDirect3DVertexDeclaration9
*
decl_ptr
=
0
;
ULONG
refcount
;
d3d9_handle
=
LoadLibraryA
(
"d3d9.dll"
);
if
(
!
d3d9_handle
)
{
skip
(
"Could not load d3d9.dll
\n
"
);
return
;
}
device_ptr
=
init_d3d9
();
if
(
!
device_ptr
)
if
(
!
(
device_ptr
=
init_d3d9
()))
{
skip
(
"Failed to initialise d3d9
\n
"
);
return
;
...
...
dlls/d3d9/tests/visual.c
View file @
a1b96349
...
...
@@ -32,8 +32,6 @@
#include <d3d9.h>
#include "wine/test.h"
static
HMODULE
d3d9_handle
=
0
;
struct
vec2
{
float
x
,
y
;
...
...
@@ -197,24 +195,18 @@ static IDirect3DDevice9 *create_device(IDirect3D9 *d3d9)
static
IDirect3DDevice9
*
init_d3d9
(
void
)
{
IDirect3D9
*
(
__stdcall
*
d3d9_create
)(
UINT
SDKVersion
)
=
0
;
IDirect3D9
*
d3d9_ptr
=
0
;
HRESULT
hr
;
D3DADAPTER_IDENTIFIER9
identifier
;
IDirect3D9
*
d3d9
;
HRESULT
hr
;
d3d9_create
=
(
void
*
)
GetProcAddress
(
d3d9_handle
,
"Direct3DCreate9"
);
ok
(
d3d9_create
!=
NULL
,
"Failed to get address of Direct3DCreate9
\n
"
);
if
(
!
d3d9_create
)
return
NULL
;
d3d9_ptr
=
d3d9_create
(
D3D_SDK_VERSION
);
if
(
!
d3d9_ptr
)
if
(
!
(
d3d9
=
Direct3DCreate9
(
D3D_SDK_VERSION
)))
{
win_skip
(
"could not create D3D9
\n
"
);
return
NULL
;
}
memset
(
&
identifier
,
0
,
sizeof
(
identifier
));
hr
=
IDirect3D9_GetAdapterIdentifier
(
d3d9
_ptr
,
0
,
0
,
&
identifier
);
hr
=
IDirect3D9_GetAdapterIdentifier
(
d3d9
,
0
,
0
,
&
identifier
);
ok
(
hr
==
D3D_OK
,
"Failed to get adapter identifier description
\n
"
);
trace
(
"Driver string:
\"
%s
\"\n
"
,
identifier
.
Driver
);
trace
(
"Description string:
\"
%s
\"\n
"
,
identifier
.
Description
);
...
...
@@ -228,7 +220,7 @@ static IDirect3DDevice9 *init_d3d9(void)
HIWORD
(
U
(
identifier
.
DriverVersion
).
HighPart
),
LOWORD
(
U
(
identifier
.
DriverVersion
).
HighPart
),
HIWORD
(
U
(
identifier
.
DriverVersion
).
LowPart
),
LOWORD
(
U
(
identifier
.
DriverVersion
).
LowPart
));
return
create_device
(
d3d9
_ptr
);
return
create_device
(
d3d9
);
}
static
void
cleanup_device
(
IDirect3DDevice9
*
device
)
...
...
@@ -15114,15 +15106,7 @@ START_TEST(visual)
HRESULT
hr
;
DWORD
color
;
d3d9_handle
=
LoadLibraryA
(
"d3d9.dll"
);
if
(
!
d3d9_handle
)
{
skip
(
"Could not load d3d9.dll
\n
"
);
return
;
}
device_ptr
=
init_d3d9
();
if
(
!
device_ptr
)
if
(
!
(
device_ptr
=
init_d3d9
()))
{
skip
(
"Creating the device failed
\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