Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
dd8bf9c8
Commit
dd8bf9c8
authored
10 years ago
by
Stefan Dösinger
Committed by
Alexandre Julliard
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
d3d8: Only one fullscreen swapchain is allowed.
parent
8b6a7a9c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/d3d8/device.c
+25
-0
25 additions, 0 deletions
dlls/d3d8/device.c
dlls/d3d8/tests/device.c
+37
-1
37 additions, 1 deletion
dlls/d3d8/tests/device.c
with
62 additions
and
1 deletion
dlls/d3d8/device.c
+
25
−
0
View file @
dd8bf9c8
...
@@ -557,11 +557,36 @@ static HRESULT WINAPI d3d8_device_CreateAdditionalSwapChain(IDirect3DDevice8 *if
...
@@ -557,11 +557,36 @@ static HRESULT WINAPI d3d8_device_CreateAdditionalSwapChain(IDirect3DDevice8 *if
struct
d3d8_device
*
device
=
impl_from_IDirect3DDevice8
(
iface
);
struct
d3d8_device
*
device
=
impl_from_IDirect3DDevice8
(
iface
);
struct
wined3d_swapchain_desc
desc
;
struct
wined3d_swapchain_desc
desc
;
struct
d3d8_swapchain
*
object
;
struct
d3d8_swapchain
*
object
;
UINT
i
,
count
;
HRESULT
hr
;
HRESULT
hr
;
TRACE
(
"iface %p, present_parameters %p, swapchain %p.
\n
"
,
TRACE
(
"iface %p, present_parameters %p, swapchain %p.
\n
"
,
iface
,
present_parameters
,
swapchain
);
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
);
wined3d_swapchain_desc_from_present_parameters
(
&
desc
,
present_parameters
);
if
(
SUCCEEDED
(
hr
=
d3d8_swapchain_create
(
device
,
&
desc
,
&
object
)))
if
(
SUCCEEDED
(
hr
=
d3d8_swapchain_create
(
device
,
&
desc
,
&
object
)))
*
swapchain
=
&
object
->
IDirect3DSwapChain8_iface
;
*
swapchain
=
&
object
->
IDirect3DSwapChain8_iface
;
...
...
This diff is collapsed.
Click to expand it.
dlls/d3d8/tests/device.c
+
37
−
1
View file @
dd8bf9c8
...
@@ -262,12 +262,16 @@ static void test_swapchain(void)
...
@@ -262,12 +262,16 @@ static void test_swapchain(void)
IDirect3DDevice8
*
device
;
IDirect3DDevice8
*
device
;
IDirect3D8
*
d3d
;
IDirect3D8
*
d3d
;
ULONG
refcount
;
ULONG
refcount
;
HWND
window
;
HWND
window
,
window2
;
HRESULT
hr
;
HRESULT
hr
;
struct
device_desc
device_desc
;
window
=
CreateWindowA
(
"d3d8_test_wc"
,
"d3d8_test"
,
WS_OVERLAPPEDWINDOW
,
window
=
CreateWindowA
(
"d3d8_test_wc"
,
"d3d8_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
NULL
,
NULL
,
NULL
,
NULL
);
0
,
0
,
640
,
480
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!!
window
,
"Failed to create a window.
\n
"
);
ok
(
!!
window
,
"Failed to create a window.
\n
"
);
window2
=
CreateWindowA
(
"d3d8_test_wc"
,
"d3d8_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!!
window2
,
"Failed to create a window.
\n
"
);
d3d
=
Direct3DCreate8
(
D3D_SDK_VERSION
);
d3d
=
Direct3DCreate8
(
D3D_SDK_VERSION
);
ok
(
!!
d3d
,
"Failed to create a D3D object.
\n
"
);
ok
(
!!
d3d
,
"Failed to create a D3D object.
\n
"
);
if
(
!
(
device
=
create_device
(
d3d
,
window
,
NULL
)))
if
(
!
(
device
=
create_device
(
d3d
,
window
,
NULL
)))
...
@@ -356,10 +360,42 @@ static void test_swapchain(void)
...
@@ -356,10 +360,42 @@ static void test_swapchain(void)
IDirect3DSwapChain8_Release
(
swapchain3
);
IDirect3DSwapChain8_Release
(
swapchain3
);
IDirect3DSwapChain8_Release
(
swapchain2
);
IDirect3DSwapChain8_Release
(
swapchain2
);
IDirect3DSwapChain8_Release
(
swapchain1
);
IDirect3DSwapChain8_Release
(
swapchain1
);
d3dpp
.
Windowed
=
FALSE
;
d3dpp
.
hDeviceWindow
=
window
;
d3dpp
.
BackBufferCount
=
1
;
hr
=
IDirect3DDevice8_CreateAdditionalSwapChain
(
device
,
&
d3dpp
,
&
swapchain1
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x
\n
"
,
hr
);
d3dpp
.
hDeviceWindow
=
window2
;
hr
=
IDirect3DDevice8_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
=
IDirect3DDevice8_CreateAdditionalSwapChain
(
device
,
&
d3dpp
,
&
swapchain1
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x
\n
"
,
hr
);
d3dpp
.
hDeviceWindow
=
window2
;
hr
=
IDirect3DDevice8_CreateAdditionalSwapChain
(
device
,
&
d3dpp
,
&
swapchain1
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x
\n
"
,
hr
);
d3dpp
.
Windowed
=
TRUE
;
d3dpp
.
hDeviceWindow
=
window
;
hr
=
IDirect3DDevice8_CreateAdditionalSwapChain
(
device
,
&
d3dpp
,
&
swapchain1
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x
\n
"
,
hr
);
d3dpp
.
hDeviceWindow
=
window2
;
hr
=
IDirect3DDevice8_CreateAdditionalSwapChain
(
device
,
&
d3dpp
,
&
swapchain1
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#x
\n
"
,
hr
);
refcount
=
IDirect3DDevice8_Release
(
device
);
refcount
=
IDirect3DDevice8_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
cleanup:
cleanup:
IDirect3D8_Release
(
d3d
);
IDirect3D8_Release
(
d3d
);
DestroyWindow
(
window2
);
DestroyWindow
(
window
);
DestroyWindow
(
window
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment