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
17c0e991
Commit
17c0e991
authored
Jul 03, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Add a small test for having multiple device active at the same time.
This is essentially the situation that caused problems with reusing the initial GL context.
parent
23ce9d72
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
device.c
dlls/d3d9/tests/device.c
+65
-0
No files found.
dlls/d3d9/tests/device.c
View file @
17c0e991
...
...
@@ -2312,6 +2312,70 @@ err_out:
return
;
}
static
void
test_multi_device
(
void
)
{
IDirect3DDevice9
*
device1
=
NULL
,
*
device2
=
NULL
;
D3DPRESENT_PARAMETERS
present_parameters
;
HWND
hwnd1
=
NULL
,
hwnd2
=
NULL
;
IDirect3D9
*
d3d9
;
ULONG
refcount
;
HRESULT
hr
;
d3d9
=
pDirect3DCreate9
(
D3D_SDK_VERSION
);
ok
(
d3d9
!=
NULL
,
"Failed to create a d3d9 object.
\n
"
);
if
(
!
d3d9
)
goto
fail
;
hwnd1
=
CreateWindow
(
"static"
,
"d3d9_test"
,
WS_OVERLAPPEDWINDOW
,
100
,
100
,
160
,
160
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hwnd1
!=
NULL
,
"Failed to create a window.
\n
"
);
if
(
!
hwnd1
)
goto
fail
;
memset
(
&
present_parameters
,
0
,
sizeof
(
present_parameters
));
present_parameters
.
Windowed
=
TRUE
;
present_parameters
.
hDeviceWindow
=
hwnd1
;
present_parameters
.
SwapEffect
=
D3DSWAPEFFECT_DISCARD
;
hr
=
IDirect3D9_CreateDevice
(
d3d9
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
hwnd1
,
D3DCREATE_SOFTWARE_VERTEXPROCESSING
,
&
present_parameters
,
&
device1
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create a device, hr %#x
\n
"
,
hr
);
IDirect3D9_Release
(
d3d9
);
d3d9
=
NULL
;
if
(
FAILED
(
hr
))
goto
fail
;
d3d9
=
pDirect3DCreate9
(
D3D_SDK_VERSION
);
ok
(
d3d9
!=
NULL
,
"Failed to create a d3d9 object.
\n
"
);
if
(
!
d3d9
)
goto
fail
;
hwnd2
=
CreateWindow
(
"static"
,
"d3d9_test"
,
WS_OVERLAPPEDWINDOW
,
100
,
100
,
160
,
160
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hwnd2
!=
NULL
,
"Failed to create a window.
\n
"
);
if
(
!
hwnd2
)
goto
fail
;
memset
(
&
present_parameters
,
0
,
sizeof
(
present_parameters
));
present_parameters
.
Windowed
=
TRUE
;
present_parameters
.
hDeviceWindow
=
hwnd2
;
present_parameters
.
SwapEffect
=
D3DSWAPEFFECT_DISCARD
;
hr
=
IDirect3D9_CreateDevice
(
d3d9
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
hwnd2
,
D3DCREATE_SOFTWARE_VERTEXPROCESSING
,
&
present_parameters
,
&
device2
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create a device, hr %#x
\n
"
,
hr
);
IDirect3D9_Release
(
d3d9
);
d3d9
=
NULL
;
if
(
FAILED
(
hr
))
goto
fail
;
fail:
if
(
d3d9
)
IDirect3D9_Release
(
d3d9
);
if
(
device1
)
{
refcount
=
IDirect3DDevice9_Release
(
device1
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
if
(
device2
)
{
refcount
=
IDirect3DDevice9_Release
(
device2
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
if
(
hwnd1
)
DestroyWindow
(
hwnd1
);
if
(
hwnd2
)
DestroyWindow
(
hwnd2
);
}
START_TEST
(
device
)
{
...
...
@@ -2334,6 +2398,7 @@ START_TEST(device)
}
IDirect3D9_Release
(
d3d9
);
test_multi_device
();
test_display_formats
();
test_display_modes
();
test_swapchain
();
...
...
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