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
8b6a7a9c
Commit
8b6a7a9c
authored
Nov 25, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Nov 25, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Only one fullscreen swapchain is allowed.
parent
2f0a4a44
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
1 deletion
+62
-1
device.c
dlls/d3d9/device.c
+25
-0
device.c
dlls/d3d9/tests/device.c
+37
-1
No files found.
dlls/d3d9/device.c
View file @
8b6a7a9c
...
...
@@ -503,11 +503,36 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_CreateAdditionalSwapChain(ID
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
struct
wined3d_swapchain_desc
desc
;
struct
d3d9_swapchain
*
object
;
UINT
i
,
count
;
HRESULT
hr
;
TRACE
(
"iface %p, present_parameters %p, swapchain %p.
\n
"
,
iface
,
present_parameters
,
swapchain
);
if
(
!
present_parameters
->
Windowed
)
{
WARN
(
"Trying to create an additional fullscreen swapchain, returning D3DERR_INVALIDCALL.
\n
"
);
return
D3DERR_INVALIDCALL
;
}
wined3d_mutex_lock
();
count
=
wined3d_device_get_swapchain_count
(
device
->
wined3d_device
);
for
(
i
=
0
;
i
<
count
;
++
i
)
{
struct
wined3d_swapchain
*
wined3d_swapchain
;
wined3d_swapchain
=
wined3d_device_get_swapchain
(
device
->
wined3d_device
,
i
);
wined3d_swapchain_get_desc
(
wined3d_swapchain
,
&
desc
);
if
(
!
desc
.
windowed
)
{
wined3d_mutex_unlock
();
WARN
(
"Trying to create an additional swapchain in fullscreen mode, returning D3DERR_INVALIDCALL.
\n
"
);
return
D3DERR_INVALIDCALL
;
}
}
wined3d_mutex_unlock
();
wined3d_swapchain_desc_from_present_parameters
(
&
desc
,
present_parameters
);
if
(
SUCCEEDED
(
hr
=
d3d9_swapchain_create
(
device
,
&
desc
,
&
object
)))
*
swapchain
=
(
IDirect3DSwapChain9
*
)
&
object
->
IDirect3DSwapChain9Ex_iface
;
...
...
dlls/d3d9/tests/device.c
View file @
8b6a7a9c
...
...
@@ -1058,12 +1058,16 @@ static void test_swapchain(void)
IDirect3DDevice9
*
device
;
IDirect3D9
*
d3d
;
ULONG
refcount
;
HWND
window
;
HWND
window
,
window2
;
HRESULT
hr
;
struct
device_desc
device_desc
;
window
=
CreateWindowA
(
"d3d9_test_wc"
,
"d3d9_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!!
window
,
"Failed to create a window.
\n
"
);
window2
=
CreateWindowA
(
"d3d9_test_wc"
,
"d3d9_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!!
window2
,
"Failed to create a window.
\n
"
);
d3d
=
Direct3DCreate9
(
D3D_SDK_VERSION
);
ok
(
!!
d3d
,
"Failed to create a D3D object.
\n
"
);
if
(
!
(
device
=
create_device
(
d3d
,
window
,
NULL
)))
...
...
@@ -1176,10 +1180,42 @@ static void test_swapchain(void)
IDirect3DSwapChain9_Release
(
swapchain3
);
IDirect3DSwapChain9_Release
(
swapchain2
);
IDirect3DSwapChain9_Release
(
swapchain1
);
d3dpp
.
Windowed
=
FALSE
;
d3dpp
.
hDeviceWindow
=
window
;
d3dpp
.
BackBufferCount
=
1
;
hr
=
IDirect3DDevice9_CreateAdditionalSwapChain
(
device
,
&
d3dpp
,
&
swapchain1
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x
\n
"
,
hr
);
d3dpp
.
hDeviceWindow
=
window2
;
hr
=
IDirect3DDevice9_CreateAdditionalSwapChain
(
device
,
&
d3dpp
,
&
swapchain1
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x
\n
"
,
hr
);
device_desc
.
width
=
registry_mode
.
dmPelsWidth
;
device_desc
.
height
=
registry_mode
.
dmPelsHeight
;
device_desc
.
device_window
=
window
;
device_desc
.
flags
=
CREATE_DEVICE_FULLSCREEN
;
hr
=
reset_device
(
device
,
&
device_desc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
d3dpp
.
hDeviceWindow
=
window
;
hr
=
IDirect3DDevice9_CreateAdditionalSwapChain
(
device
,
&
d3dpp
,
&
swapchain1
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x
\n
"
,
hr
);
d3dpp
.
hDeviceWindow
=
window2
;
hr
=
IDirect3DDevice9_CreateAdditionalSwapChain
(
device
,
&
d3dpp
,
&
swapchain1
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x
\n
"
,
hr
);
d3dpp
.
Windowed
=
TRUE
;
d3dpp
.
hDeviceWindow
=
window
;
hr
=
IDirect3DDevice9_CreateAdditionalSwapChain
(
device
,
&
d3dpp
,
&
swapchain1
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x
\n
"
,
hr
);
d3dpp
.
hDeviceWindow
=
window2
;
hr
=
IDirect3DDevice9_CreateAdditionalSwapChain
(
device
,
&
d3dpp
,
&
swapchain1
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x
\n
"
,
hr
);
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
cleanup:
IDirect3D9_Release
(
d3d
);
DestroyWindow
(
window2
);
DestroyWindow
(
window
);
}
...
...
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