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
18a7653c
Commit
18a7653c
authored
Nov 16, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 17, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of the WINED3DDISPLAYMODE typedef.
parent
7cce4453
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
166 additions
and
162 deletions
+166
-162
device.c
dlls/d3d8/device.c
+1
-1
directx.c
dlls/d3d8/directx.c
+3
-2
device.c
dlls/d3d9/device.c
+1
-1
directx.c
dlls/d3d9/directx.c
+2
-2
swapchain.c
dlls/d3d9/swapchain.c
+1
-1
ddraw.c
dlls/ddraw/ddraw.c
+69
-67
device.c
dlls/ddraw/device.c
+5
-5
output.c
dlls/dxgi/output.c
+4
-4
device.c
dlls/wined3d/device.c
+33
-33
directx.c
dlls/wined3d/directx.c
+18
-18
swapchain.c
dlls/wined3d/swapchain.c
+18
-17
wined3d.h
include/wine/wined3d.h
+11
-11
No files found.
dlls/d3d8/device.c
View file @
18a7653c
...
...
@@ -422,7 +422,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetDisplayMode(IDirect3DDevice8 *ifac
TRACE
(
"iface %p, mode %p.
\n
"
,
iface
,
pMode
);
wined3d_mutex_lock
();
hr
=
wined3d_device_get_display_mode
(
This
->
wined3d_device
,
0
,
(
WINED3DDISPLAYMODE
*
)
pMode
);
hr
=
wined3d_device_get_display_mode
(
This
->
wined3d_device
,
0
,
(
struct
wined3d_display_mode
*
)
pMode
);
wined3d_mutex_unlock
();
if
(
SUCCEEDED
(
hr
))
pMode
->
Format
=
d3dformat_from_wined3dformat
(
pMode
->
Format
);
...
...
dlls/d3d8/directx.c
View file @
18a7653c
...
...
@@ -175,7 +175,8 @@ static HRESULT WINAPI IDirect3D8Impl_EnumAdapterModes(LPDIRECT3D8 iface, UINT Ad
iface
,
Adapter
,
Mode
,
pMode
);
wined3d_mutex_lock
();
hr
=
wined3d_enum_adapter_modes
(
This
->
WineD3D
,
Adapter
,
WINED3DFMT_UNKNOWN
,
Mode
,
(
WINED3DDISPLAYMODE
*
)
pMode
);
hr
=
wined3d_enum_adapter_modes
(
This
->
WineD3D
,
Adapter
,
WINED3DFMT_UNKNOWN
,
Mode
,
(
struct
wined3d_display_mode
*
)
pMode
);
wined3d_mutex_unlock
();
if
(
SUCCEEDED
(
hr
))
pMode
->
Format
=
d3dformat_from_wined3dformat
(
pMode
->
Format
);
...
...
@@ -193,7 +194,7 @@ static HRESULT WINAPI IDirect3D8Impl_GetAdapterDisplayMode(LPDIRECT3D8 iface, UI
iface
,
Adapter
,
pMode
);
wined3d_mutex_lock
();
hr
=
wined3d_get_adapter_display_mode
(
This
->
WineD3D
,
Adapter
,
(
WINED3DDISPLAYMODE
*
)
pMode
);
hr
=
wined3d_get_adapter_display_mode
(
This
->
WineD3D
,
Adapter
,
(
struct
wined3d_display_mode
*
)
pMode
);
wined3d_mutex_unlock
();
if
(
SUCCEEDED
(
hr
))
pMode
->
Format
=
d3dformat_from_wined3dformat
(
pMode
->
Format
);
...
...
dlls/d3d9/device.c
View file @
18a7653c
...
...
@@ -371,7 +371,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetDisplayMode(IDirect3DDevice9Ex *if
TRACE
(
"iface %p, swapchain %u, mode %p.
\n
"
,
iface
,
iSwapChain
,
pMode
);
wined3d_mutex_lock
();
hr
=
wined3d_device_get_display_mode
(
This
->
wined3d_device
,
iSwapChain
,
(
WINED3DDISPLAYMODE
*
)
pMode
);
hr
=
wined3d_device_get_display_mode
(
This
->
wined3d_device
,
iSwapChain
,
(
struct
wined3d_display_mode
*
)
pMode
);
wined3d_mutex_unlock
();
if
(
SUCCEEDED
(
hr
))
pMode
->
Format
=
d3dformat_from_wined3dformat
(
pMode
->
Format
);
...
...
dlls/d3d9/directx.c
View file @
18a7653c
...
...
@@ -185,7 +185,7 @@ static HRESULT WINAPI IDirect3D9Impl_EnumAdapterModes(IDirect3D9Ex *iface, UINT
wined3d_mutex_lock
();
hr
=
wined3d_enum_adapter_modes
(
This
->
WineD3D
,
Adapter
,
wined3dformat_from_d3dformat
(
Format
),
Mode
,
(
WINED3DDISPLAYMODE
*
)
pMode
);
Mode
,
(
struct
wined3d_display_mode
*
)
pMode
);
wined3d_mutex_unlock
();
if
(
SUCCEEDED
(
hr
))
pMode
->
Format
=
d3dformat_from_wined3dformat
(
pMode
->
Format
);
...
...
@@ -202,7 +202,7 @@ static HRESULT WINAPI IDirect3D9Impl_GetAdapterDisplayMode(IDirect3D9Ex *iface,
TRACE
(
"iface %p, adapter %u, mode %p.
\n
"
,
iface
,
Adapter
,
pMode
);
wined3d_mutex_lock
();
hr
=
wined3d_get_adapter_display_mode
(
This
->
WineD3D
,
Adapter
,
(
WINED3DDISPLAYMODE
*
)
pMode
);
hr
=
wined3d_get_adapter_display_mode
(
This
->
WineD3D
,
Adapter
,
(
struct
wined3d_display_mode
*
)
pMode
);
wined3d_mutex_unlock
();
if
(
SUCCEEDED
(
hr
))
pMode
->
Format
=
d3dformat_from_wined3dformat
(
pMode
->
Format
);
...
...
dlls/d3d9/swapchain.c
View file @
18a7653c
...
...
@@ -159,7 +159,7 @@ static HRESULT WINAPI IDirect3DSwapChain9Impl_GetDisplayMode(LPDIRECT3DSWAPCHAIN
TRACE
(
"iface %p, mode %p.
\n
"
,
iface
,
pMode
);
wined3d_mutex_lock
();
hr
=
wined3d_swapchain_get_display_mode
(
This
->
wined3d_swapchain
,
(
WINED3DDISPLAYMODE
*
)
pMode
);
hr
=
wined3d_swapchain_get_display_mode
(
This
->
wined3d_swapchain
,
(
struct
wined3d_display_mode
*
)
pMode
);
wined3d_mutex_unlock
();
if
(
SUCCEEDED
(
hr
))
pMode
->
Format
=
d3dformat_from_wined3dformat
(
pMode
->
Format
);
...
...
dlls/ddraw/ddraw.c
View file @
18a7653c
...
...
@@ -739,11 +739,11 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
if
(
cooplevel
&
DDSCL_FULLSCREEN
)
{
WINED3DDISPLAYMODE
display_mode
;
struct
wined3d_display_mode
display_mode
;
wined3d_get_adapter_display_mode
(
This
->
wineD3D
,
WINED3DADAPTER_DEFAULT
,
&
display_mode
);
wined3d_device_setup_fullscreen_window
(
This
->
wined3d_device
,
hwnd
,
display_mode
.
Width
,
display_mode
.
H
eight
);
display_mode
.
width
,
display_mode
.
h
eight
);
}
}
...
...
@@ -847,8 +847,8 @@ static HRESULT WINAPI ddraw1_SetCooperativeLevel(IDirectDraw *iface, HWND window
static
HRESULT
ddraw_set_display_mode
(
IDirectDrawImpl
*
ddraw
,
DWORD
Width
,
DWORD
Height
,
DWORD
BPP
,
DWORD
RefreshRate
,
DWORD
Flags
)
{
struct
wined3d_display_mode
mode
;
enum
wined3d_format_id
format
;
WINED3DDISPLAYMODE
Mode
;
HRESULT
hr
;
TRACE
(
"ddraw %p, width %u, height %u, bpp %u, refresh_rate %u, flags %#x.
\n
"
,
ddraw
,
Width
,
...
...
@@ -873,14 +873,14 @@ static HRESULT ddraw_set_display_mode(IDirectDrawImpl *ddraw, DWORD Width, DWORD
default:
format
=
WINED3DFMT_UNKNOWN
;
break
;
}
if
(
FAILED
(
hr
=
wined3d_device_get_display_mode
(
ddraw
->
wined3d_device
,
0
,
&
M
ode
)))
if
(
FAILED
(
hr
=
wined3d_device_get_display_mode
(
ddraw
->
wined3d_device
,
0
,
&
m
ode
)))
{
ERR
(
"Failed to get current display mode, hr %#x.
\n
"
,
hr
);
}
else
if
(
Mode
.
W
idth
==
Width
&&
Mode
.
H
eight
==
Height
&&
Mode
.
Format
==
format
&&
Mode
.
RefreshR
ate
==
RefreshRate
)
else
if
(
mode
.
w
idth
==
Width
&&
mode
.
h
eight
==
Height
&&
mode
.
format_id
==
format
&&
mode
.
refresh_r
ate
==
RefreshRate
)
{
TRACE
(
"Skipping redundant mode setting call.
\n
"
);
wined3d_mutex_unlock
();
...
...
@@ -896,10 +896,10 @@ static HRESULT ddraw_set_display_mode(IDirectDrawImpl *ddraw, DWORD Width, DWORD
* depends on this
*/
Mode
.
W
idth
=
Width
;
Mode
.
H
eight
=
Height
;
Mode
.
RefreshR
ate
=
RefreshRate
;
Mode
.
Format
=
format
;
mode
.
w
idth
=
Width
;
mode
.
h
eight
=
Height
;
mode
.
refresh_r
ate
=
RefreshRate
;
mode
.
format_id
=
format
;
/* TODO: The possible return values from msdn suggest that
* the screen mode can't be changed if a surface is locked
...
...
@@ -907,7 +907,7 @@ static HRESULT ddraw_set_display_mode(IDirectDrawImpl *ddraw, DWORD Width, DWORD
*/
/* TODO: Lose the primary surface */
hr
=
wined3d_device_set_display_mode
(
ddraw
->
wined3d_device
,
0
,
&
M
ode
);
hr
=
wined3d_device_set_display_mode
(
ddraw
->
wined3d_device
,
0
,
&
m
ode
);
if
(
ddraw
->
cooperative_level
&
DDSCL_EXCLUSIVE
)
SetWindowPos
(
ddraw
->
dest_window
,
HWND_TOP
,
0
,
0
,
Width
,
Height
,
SWP_SHOWWINDOW
|
SWP_NOACTIVATE
);
...
...
@@ -1239,8 +1239,8 @@ static HRESULT WINAPI ddraw1_Compact(IDirectDraw *iface)
static
HRESULT
WINAPI
ddraw7_GetDisplayMode
(
IDirectDraw7
*
iface
,
DDSURFACEDESC2
*
DDSD
)
{
IDirectDrawImpl
*
This
=
impl_from_IDirectDraw7
(
iface
);
struct
wined3d_display_mode
mode
;
HRESULT
hr
;
WINED3DDISPLAYMODE
Mode
;
DWORD
Size
;
TRACE
(
"iface %p, surface_desc %p.
\n
"
,
iface
,
DDSD
);
...
...
@@ -1255,7 +1255,7 @@ static HRESULT WINAPI ddraw7_GetDisplayMode(IDirectDraw7 *iface, DDSURFACEDESC2
/* The necessary members of LPDDSURFACEDESC and LPDDSURFACEDESC2 are equal,
* so one method can be used for all versions (Hopefully) */
hr
=
wined3d_device_get_display_mode
(
This
->
wined3d_device
,
0
,
&
M
ode
);
hr
=
wined3d_device_get_display_mode
(
This
->
wined3d_device
,
0
,
&
m
ode
);
if
(
FAILED
(
hr
))
{
ERR
(
" (%p) IWineD3DDevice::GetDisplayMode returned %08x
\n
"
,
This
,
hr
);
...
...
@@ -1268,13 +1268,13 @@ static HRESULT WINAPI ddraw7_GetDisplayMode(IDirectDraw7 *iface, DDSURFACEDESC2
DDSD
->
dwSize
=
Size
;
DDSD
->
dwFlags
|=
DDSD_HEIGHT
|
DDSD_WIDTH
|
DDSD_PIXELFORMAT
|
DDSD_PITCH
|
DDSD_REFRESHRATE
;
DDSD
->
dwWidth
=
Mode
.
W
idth
;
DDSD
->
dwHeight
=
Mode
.
H
eight
;
DDSD
->
dwWidth
=
mode
.
w
idth
;
DDSD
->
dwHeight
=
mode
.
h
eight
;
DDSD
->
u2
.
dwRefreshRate
=
60
;
DDSD
->
ddsCaps
.
dwCaps
=
0
;
DDSD
->
u4
.
ddpfPixelFormat
.
dwSize
=
sizeof
(
DDSD
->
u4
.
ddpfPixelFormat
);
PixelFormat_WineD3DtoDD
(
&
DDSD
->
u4
.
ddpfPixelFormat
,
Mode
.
Format
);
DDSD
->
u1
.
lPitch
=
Mode
.
W
idth
*
DDSD
->
u4
.
ddpfPixelFormat
.
u1
.
dwRGBBitCount
/
8
;
PixelFormat_WineD3DtoDD
(
&
DDSD
->
u4
.
ddpfPixelFormat
,
mode
.
format_id
);
DDSD
->
u1
.
lPitch
=
mode
.
w
idth
*
DDSD
->
u4
.
ddpfPixelFormat
.
u1
.
dwRGBBitCount
/
8
;
if
(
TRACE_ON
(
ddraw
))
{
...
...
@@ -1342,20 +1342,20 @@ static HRESULT WINAPI ddraw7_GetFourCCCodes(IDirectDraw7 *iface, DWORD *NumCodes
WINED3DFMT_DXT1
,
WINED3DFMT_DXT2
,
WINED3DFMT_DXT3
,
WINED3DFMT_DXT4
,
WINED3DFMT_DXT5
,
WINED3DFMT_ATI2N
,
WINED3DFMT_NVHU
,
WINED3DFMT_NVHS
};
struct
wined3d_display_mode
mode
;
DWORD
count
=
0
,
i
,
outsize
;
HRESULT
hr
;
WINED3DDISPLAYMODE
d3ddm
;
TRACE
(
"iface %p, codes_count %p, codes %p.
\n
"
,
iface
,
NumCodes
,
Codes
);
wined3d_device_get_display_mode
(
This
->
wined3d_device
,
0
,
&
d3ddm
);
wined3d_device_get_display_mode
(
This
->
wined3d_device
,
0
,
&
mode
);
outsize
=
NumCodes
&&
Codes
?
*
NumCodes
:
0
;
for
(
i
=
0
;
i
<
(
sizeof
(
formats
)
/
sizeof
(
formats
[
0
]));
++
i
)
{
hr
=
wined3d_check_device_format
(
This
->
wineD3D
,
WINED3DADAPTER_DEFAULT
,
WINED3DDEVTYPE_HAL
,
d3ddm
.
Format
,
0
,
WINED3DRTYPE_SURFACE
,
formats
[
i
],
DefaultSurfaceType
);
mode
.
format_id
,
0
,
WINED3DRTYPE_SURFACE
,
formats
[
i
],
DefaultSurfaceType
);
if
(
SUCCEEDED
(
hr
))
{
if
(
count
<
outsize
)
...
...
@@ -1776,9 +1776,9 @@ static HRESULT WINAPI ddraw1_WaitForVerticalBlank(IDirectDraw *iface, DWORD flag
static
HRESULT
WINAPI
ddraw7_GetScanLine
(
IDirectDraw7
*
iface
,
DWORD
*
Scanline
)
{
IDirectDrawImpl
*
This
=
impl_from_IDirectDraw7
(
iface
);
struct
wined3d_display_mode
mode
;
static
DWORD
cur_scanline
;
static
BOOL
hide
=
FALSE
;
WINED3DDISPLAYMODE
Mode
;
TRACE
(
"iface %p, line %p.
\n
"
,
iface
,
Scanline
);
...
...
@@ -1790,14 +1790,14 @@ static HRESULT WINAPI ddraw7_GetScanLine(IDirectDraw7 *iface, DWORD *Scanline)
}
wined3d_mutex_lock
();
wined3d_device_get_display_mode
(
This
->
wined3d_device
,
0
,
&
M
ode
);
wined3d_device_get_display_mode
(
This
->
wined3d_device
,
0
,
&
m
ode
);
wined3d_mutex_unlock
();
/* Fake the line sweeping of the monitor */
/* FIXME: We should synchronize with a source to keep the refresh rate */
*
Scanline
=
cur_scanline
++
;
/* Assume 20 scan lines in the vertical blank */
if
(
cur_scanline
>=
Mode
.
H
eight
+
20
)
if
(
cur_scanline
>=
mode
.
h
eight
+
20
)
cur_scanline
=
0
;
return
DD_OK
;
...
...
@@ -1999,10 +1999,10 @@ static HRESULT WINAPI ddraw7_EnumDisplayModes(IDirectDraw7 *iface, DWORD Flags,
DDSURFACEDESC2
*
DDSD
,
void
*
Context
,
LPDDENUMMODESCALLBACK2
cb
)
{
IDirectDrawImpl
*
This
=
impl_from_IDirectDraw7
(
iface
);
struct
wined3d_display_mode
*
enum_modes
=
NULL
;
struct
wined3d_display_mode
mode
;
unsigned
int
modenum
,
fmt
;
WINED3DDISPLAYMODE
mode
;
DDSURFACEDESC2
callback_sd
;
WINED3DDISPLAYMODE
*
enum_modes
=
NULL
;
unsigned
enum_mode_count
=
0
,
enum_mode_array_size
=
0
;
DDPIXELFORMAT
pixelformat
;
...
...
@@ -2023,7 +2023,7 @@ static HRESULT WINAPI ddraw7_EnumDisplayModes(IDirectDraw7 *iface, DWORD Flags,
if
(
!
(
Flags
&
DDEDM_REFRESHRATES
))
{
enum_mode_array_size
=
16
;
enum_modes
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WINED3DDISPLAYMODE
)
*
enum_mode_array_size
);
enum_modes
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
enum_modes
)
*
enum_mode_array_size
);
if
(
!
enum_modes
)
{
ERR
(
"Out of memory
\n
"
);
...
...
@@ -2039,14 +2039,18 @@ static HRESULT WINAPI ddraw7_EnumDisplayModes(IDirectDraw7 *iface, DWORD Flags,
while
(
wined3d_enum_adapter_modes
(
This
->
wineD3D
,
WINED3DADAPTER_DEFAULT
,
checkFormatList
[
fmt
],
modenum
++
,
&
mode
)
==
WINED3D_OK
)
{
PixelFormat_WineD3DtoDD
(
&
pixelformat
,
mode
.
Format
);
if
(
DDSD
)
PixelFormat_WineD3DtoDD
(
&
pixelformat
,
mode
.
format_id
);
if
(
DDSD
)
{
if
(
DDSD
->
dwFlags
&
DDSD_WIDTH
&&
mode
.
Width
!=
DDSD
->
dwWidth
)
continue
;
if
(
DDSD
->
dwFlags
&
DDSD_HEIGHT
&&
mode
.
Height
!=
DDSD
->
dwHeight
)
continue
;
if
(
DDSD
->
dwFlags
&
DDSD_REFRESHRATE
&&
mode
.
RefreshRate
!=
DDSD
->
u2
.
dwRefreshRate
)
continue
;
if
(
DDSD
->
dwFlags
&
DDSD_PIXELFORMAT
&&
pixelformat
.
u1
.
dwRGBBitCount
!=
DDSD
->
u4
.
ddpfPixelFormat
.
u1
.
dwRGBBitCount
)
continue
;
if
(
DDSD
->
dwFlags
&
DDSD_WIDTH
&&
mode
.
width
!=
DDSD
->
dwWidth
)
continue
;
if
(
DDSD
->
dwFlags
&
DDSD_HEIGHT
&&
mode
.
height
!=
DDSD
->
dwHeight
)
continue
;
if
(
DDSD
->
dwFlags
&
DDSD_REFRESHRATE
&&
mode
.
refresh_rate
!=
DDSD
->
u2
.
dwRefreshRate
)
continue
;
if
(
DDSD
->
dwFlags
&
DDSD_PIXELFORMAT
&&
pixelformat
.
u1
.
dwRGBBitCount
!=
DDSD
->
u4
.
ddpfPixelFormat
.
u1
.
dwRGBBitCount
)
continue
;
}
if
(
!
(
Flags
&
DDEDM_REFRESHRATES
))
...
...
@@ -2060,8 +2064,8 @@ static HRESULT WINAPI ddraw7_EnumDisplayModes(IDirectDraw7 *iface, DWORD Flags,
for
(
i
=
0
;
i
<
enum_mode_count
;
i
++
)
{
if
(
enum_modes
[
i
].
Width
==
mode
.
Width
&&
enum_modes
[
i
].
Height
==
mode
.
Height
&&
enum_modes
[
i
].
Format
==
mode
.
Format
)
if
(
enum_modes
[
i
].
width
==
mode
.
width
&&
enum_modes
[
i
].
height
==
mode
.
height
&&
enum_modes
[
i
].
format_id
==
mode
.
format_id
)
{
found
=
TRUE
;
break
;
...
...
@@ -2076,18 +2080,16 @@ static HRESULT WINAPI ddraw7_EnumDisplayModes(IDirectDraw7 *iface, DWORD Flags,
callback_sd
.
u4
.
ddpfPixelFormat
.
dwSize
=
sizeof
(
DDPIXELFORMAT
);
callback_sd
.
dwFlags
=
DDSD_HEIGHT
|
DDSD_WIDTH
|
DDSD_PIXELFORMAT
|
DDSD_PITCH
|
DDSD_REFRESHRATE
;
if
(
Flags
&
DDEDM_REFRESHRATES
)
{
callback_sd
.
u2
.
dwRefreshRate
=
mode
.
RefreshRate
;
}
if
(
Flags
&
DDEDM_REFRESHRATES
)
callback_sd
.
u2
.
dwRefreshRate
=
mode
.
refresh_rate
;
callback_sd
.
dwWidth
=
mode
.
W
idth
;
callback_sd
.
dwHeight
=
mode
.
H
eight
;
callback_sd
.
dwWidth
=
mode
.
w
idth
;
callback_sd
.
dwHeight
=
mode
.
h
eight
;
callback_sd
.
u4
.
ddpfPixelFormat
=
pixelformat
;
/* Calc pitch and DWORD align like MSDN says */
callback_sd
.
u1
.
lPitch
=
(
callback_sd
.
u4
.
ddpfPixelFormat
.
u1
.
dwRGBBitCount
/
8
)
*
mode
.
W
idth
;
callback_sd
.
u1
.
lPitch
=
(
callback_sd
.
u4
.
ddpfPixelFormat
.
u1
.
dwRGBBitCount
/
8
)
*
mode
.
w
idth
;
callback_sd
.
u1
.
lPitch
=
(
callback_sd
.
u1
.
lPitch
+
3
)
&
~
3
;
TRACE
(
"Enumerating %dx%dx%d @%d
\n
"
,
callback_sd
.
dwWidth
,
callback_sd
.
dwHeight
,
callback_sd
.
u4
.
ddpfPixelFormat
.
u1
.
dwRGBBitCount
,
...
...
@@ -2105,11 +2107,11 @@ static HRESULT WINAPI ddraw7_EnumDisplayModes(IDirectDraw7 *iface, DWORD Flags,
{
if
(
enum_mode_count
==
enum_mode_array_size
)
{
WINED3DDISPLAYMODE
*
new_enum_modes
;
struct
wined3d_display_mode
*
new_enum_modes
;
enum_mode_array_size
*=
2
;
new_enum_modes
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
enum_modes
,
sizeof
(
WINED3DDISPLAYMODE
)
*
enum_mode_array_size
);
new_enum_modes
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
enum_modes
,
sizeof
(
*
new_enum_modes
)
*
enum_mode_array_size
);
if
(
!
new_enum_modes
)
{
ERR
(
"Out of memory
\n
"
);
...
...
@@ -2596,7 +2598,7 @@ static HRESULT ddraw_create_swapchain(IDirectDrawImpl *ddraw, IDirectDrawSurface
{
WINED3DPRESENT_PARAMETERS
presentation_parameters
;
IDirectDrawSurfaceImpl
*
target
=
surface
;
WINED3DDISPLAYMODE
mode
;
struct
wined3d_display_mode
mode
;
HRESULT
hr
=
WINED3D_OK
;
/* FIXME: wined3d_get_adapter_display_mode() would be more appropriate
...
...
@@ -2617,9 +2619,9 @@ static HRESULT ddraw_create_swapchain(IDirectDrawImpl *ddraw, IDirectDrawSurface
}
memset
(
&
presentation_parameters
,
0
,
sizeof
(
presentation_parameters
));
presentation_parameters
.
BackBufferWidth
=
mode
.
W
idth
;
presentation_parameters
.
BackBufferHeight
=
mode
.
H
eight
;
presentation_parameters
.
BackBufferFormat
=
mode
.
Format
;
presentation_parameters
.
BackBufferWidth
=
mode
.
w
idth
;
presentation_parameters
.
BackBufferHeight
=
mode
.
h
eight
;
presentation_parameters
.
BackBufferFormat
=
mode
.
format_id
;
presentation_parameters
.
SwapEffect
=
WINED3DSWAPEFFECT_COPY
;
presentation_parameters
.
hDeviceWindow
=
ddraw
->
dest_window
;
presentation_parameters
.
Windowed
=
!
(
ddraw
->
cooperative_level
&
DDSCL_FULLSCREEN
);
...
...
@@ -2739,10 +2741,10 @@ static HRESULT CreateSurface(IDirectDrawImpl *ddraw, DDSURFACEDESC2 *DDSD,
IDirectDrawSurfaceImpl
**
Surf
,
IUnknown
*
UnkOuter
,
UINT
version
)
{
IDirectDrawSurfaceImpl
*
object
=
NULL
;
struct
wined3d_display_mode
mode
;
HRESULT
hr
;
LONG
extra_surfaces
=
0
;
DDSURFACEDESC2
desc2
;
WINED3DDISPLAYMODE
Mode
;
const
DWORD
sysvidmem
=
DDSCAPS_VIDEOMEMORY
|
DDSCAPS_SYSTEMMEMORY
;
TRACE
(
"ddraw %p, surface_desc %p, surface %p, outer_unknown %p.
\n
"
,
ddraw
,
DDSD
,
Surf
,
UnkOuter
);
...
...
@@ -2850,34 +2852,34 @@ static HRESULT CreateSurface(IDirectDrawImpl *ddraw, DDSURFACEDESC2 *DDSD,
desc2
.
u4
.
ddpfPixelFormat
.
dwSize
=
sizeof
(
DDPIXELFORMAT
);
/* Just to be sure */
/* Get the video mode from WineD3D - we will need it */
hr
=
wined3d_device_get_display_mode
(
ddraw
->
wined3d_device
,
0
,
&
M
ode
);
hr
=
wined3d_device_get_display_mode
(
ddraw
->
wined3d_device
,
0
,
&
m
ode
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to read display mode from wined3d
\n
"
);
switch
(
ddraw
->
orig_bpp
)
{
case
8
:
Mode
.
Format
=
WINED3DFMT_P8_UINT
;
mode
.
format_id
=
WINED3DFMT_P8_UINT
;
break
;
case
15
:
Mode
.
Format
=
WINED3DFMT_B5G5R5X1_UNORM
;
mode
.
format_id
=
WINED3DFMT_B5G5R5X1_UNORM
;
break
;
case
16
:
Mode
.
Format
=
WINED3DFMT_B5G6R5_UNORM
;
mode
.
format_id
=
WINED3DFMT_B5G6R5_UNORM
;
break
;
case
24
:
Mode
.
Format
=
WINED3DFMT_B8G8R8_UNORM
;
mode
.
format_id
=
WINED3DFMT_B8G8R8_UNORM
;
break
;
case
32
:
Mode
.
Format
=
WINED3DFMT_B8G8R8X8_UNORM
;
mode
.
format_id
=
WINED3DFMT_B8G8R8X8_UNORM
;
break
;
}
Mode
.
W
idth
=
ddraw
->
orig_width
;
Mode
.
H
eight
=
ddraw
->
orig_height
;
mode
.
w
idth
=
ddraw
->
orig_width
;
mode
.
h
eight
=
ddraw
->
orig_height
;
}
/* No pixelformat given? Use the current screen format */
...
...
@@ -2886,7 +2888,7 @@ static HRESULT CreateSurface(IDirectDrawImpl *ddraw, DDSURFACEDESC2 *DDSD,
desc2
.
dwFlags
|=
DDSD_PIXELFORMAT
;
desc2
.
u4
.
ddpfPixelFormat
.
dwSize
=
sizeof
(
DDPIXELFORMAT
);
PixelFormat_WineD3DtoDD
(
&
desc2
.
u4
.
ddpfPixelFormat
,
Mode
.
Format
);
PixelFormat_WineD3DtoDD
(
&
desc2
.
u4
.
ddpfPixelFormat
,
mode
.
format_id
);
}
/* No Width or no Height? Use the original screen size
...
...
@@ -2904,8 +2906,8 @@ static HRESULT CreateSurface(IDirectDrawImpl *ddraw, DDSURFACEDESC2 *DDSD,
}
desc2
.
dwFlags
|=
DDSD_WIDTH
|
DDSD_HEIGHT
;
desc2
.
dwWidth
=
Mode
.
W
idth
;
desc2
.
dwHeight
=
Mode
.
H
eight
;
desc2
.
dwWidth
=
mode
.
w
idth
;
desc2
.
dwHeight
=
mode
.
h
eight
;
}
if
(
!
desc2
.
dwWidth
||
!
desc2
.
dwHeight
)
...
...
@@ -4544,7 +4546,7 @@ static HRESULT WINAPI d3d7_EnumZBufferFormats(IDirect3D7 *iface, REFCLSID device
LPD3DENUMPIXELFORMATSCALLBACK
callback
,
void
*
context
)
{
IDirectDrawImpl
*
This
=
impl_from_IDirect3D7
(
iface
);
WINED3DDISPLAYMODE
d3ddm
;
struct
wined3d_display_mode
mode
;
WINED3DDEVTYPE
type
;
unsigned
int
i
;
HRESULT
hr
;
...
...
@@ -4602,11 +4604,11 @@ static HRESULT WINAPI d3d7_EnumZBufferFormats(IDirect3D7 *iface, REFCLSID device
* not like that we'll have to find some workaround, like iterating over
* all imaginable formats and collecting all the depth stencil formats we
* can get. */
hr
=
wined3d_device_get_display_mode
(
This
->
wined3d_device
,
0
,
&
d3ddm
);
hr
=
wined3d_device_get_display_mode
(
This
->
wined3d_device
,
0
,
&
mode
);
for
(
i
=
0
;
i
<
(
sizeof
(
formats
)
/
sizeof
(
*
formats
));
++
i
)
{
hr
=
wined3d_check_device_format
(
This
->
wineD3D
,
WINED3DADAPTER_DEFAULT
,
type
,
d3ddm
.
Format
,
hr
=
wined3d_check_device_format
(
This
->
wineD3D
,
WINED3DADAPTER_DEFAULT
,
type
,
mode
.
format_id
,
WINED3DUSAGE_DEPTHSTENCIL
,
WINED3DRTYPE_SURFACE
,
formats
[
i
],
SURFACE_OPENGL
);
if
(
SUCCEEDED
(
hr
))
{
...
...
@@ -4631,7 +4633,7 @@ static HRESULT WINAPI d3d7_EnumZBufferFormats(IDirect3D7 *iface, REFCLSID device
* while others used dwZBufferBitDepth=32. In either case the pitch matches a 32 bits per
* pixel format, so we use dwZBufferBitDepth=32. Some games expect 24. Windows Vista and
* newer enumerate both versions, so we do the same(bug 22434) */
hr
=
wined3d_check_device_format
(
This
->
wineD3D
,
WINED3DADAPTER_DEFAULT
,
type
,
d3ddm
.
Format
,
hr
=
wined3d_check_device_format
(
This
->
wineD3D
,
WINED3DADAPTER_DEFAULT
,
type
,
mode
.
format_id
,
WINED3DUSAGE_DEPTHSTENCIL
,
WINED3DRTYPE_SURFACE
,
WINED3DFMT_X8D24_UNORM
,
SURFACE_OPENGL
);
if
(
SUCCEEDED
(
hr
))
{
...
...
dlls/ddraw/device.c
View file @
18a7653c
...
...
@@ -1053,8 +1053,8 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface,
void
*
Arg
)
{
IDirect3DDeviceImpl
*
This
=
impl_from_IDirect3DDevice7
(
iface
);
struct
wined3d_display_mode
mode
;
HRESULT
hr
;
WINED3DDISPLAYMODE
mode
;
unsigned
int
i
;
static
const
enum
wined3d_format_id
FormatList
[]
=
...
...
@@ -1107,7 +1107,7 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface,
for
(
i
=
0
;
i
<
sizeof
(
FormatList
)
/
sizeof
(
*
FormatList
);
++
i
)
{
hr
=
wined3d_check_device_format
(
This
->
ddraw
->
wineD3D
,
WINED3DADAPTER_DEFAULT
,
WINED3DDEVTYPE_HAL
,
mode
.
Format
,
0
,
WINED3DRTYPE_TEXTURE
,
FormatList
[
i
],
SURFACE_OPENGL
);
mode
.
format_id
,
0
,
WINED3DRTYPE_TEXTURE
,
FormatList
[
i
],
SURFACE_OPENGL
);
if
(
hr
==
D3D_OK
)
{
DDPIXELFORMAT
pformat
;
...
...
@@ -1130,7 +1130,7 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface,
for
(
i
=
0
;
i
<
sizeof
(
BumpFormatList
)
/
sizeof
(
*
BumpFormatList
);
++
i
)
{
hr
=
wined3d_check_device_format
(
This
->
ddraw
->
wineD3D
,
WINED3DADAPTER_DEFAULT
,
WINED3DDEVTYPE_HAL
,
mode
.
Format
,
WINED3DUSAGE_QUERY_LEGACYBUMPMAP
,
WINED3DDEVTYPE_HAL
,
mode
.
format_id
,
WINED3DUSAGE_QUERY_LEGACYBUMPMAP
,
WINED3DRTYPE_TEXTURE
,
BumpFormatList
[
i
],
SURFACE_OPENGL
);
if
(
hr
==
D3D_OK
)
{
...
...
@@ -1205,9 +1205,9 @@ IDirect3DDeviceImpl_2_EnumTextureFormats(IDirect3DDevice2 *iface,
void
*
Arg
)
{
IDirect3DDeviceImpl
*
This
=
impl_from_IDirect3DDevice2
(
iface
);
struct
wined3d_display_mode
mode
;
HRESULT
hr
;
unsigned
int
i
;
WINED3DDISPLAYMODE
mode
;
static
const
enum
wined3d_format_id
FormatList
[]
=
{
...
...
@@ -1246,7 +1246,7 @@ IDirect3DDeviceImpl_2_EnumTextureFormats(IDirect3DDevice2 *iface,
for
(
i
=
0
;
i
<
sizeof
(
FormatList
)
/
sizeof
(
*
FormatList
);
++
i
)
{
hr
=
wined3d_check_device_format
(
This
->
ddraw
->
wineD3D
,
0
,
WINED3DDEVTYPE_HAL
,
mode
.
Format
,
0
,
WINED3DRTYPE_TEXTURE
,
FormatList
[
i
],
SURFACE_OPENGL
);
mode
.
format_id
,
0
,
WINED3DRTYPE_TEXTURE
,
FormatList
[
i
],
SURFACE_OPENGL
);
if
(
hr
==
D3D_OK
)
{
DDSURFACEDESC
sdesc
;
...
...
dlls/dxgi/output.c
View file @
18a7653c
...
...
@@ -160,7 +160,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *ifa
for
(
i
=
0
;
i
<
*
mode_count
;
++
i
)
{
WINED3DDISPLAYMODE
mode
;
struct
wined3d_display_mode
mode
;
HRESULT
hr
;
hr
=
wined3d_enum_adapter_modes
(
wined3d
,
This
->
adapter
->
ordinal
,
wined3d_format
,
i
,
&
mode
);
...
...
@@ -172,9 +172,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *ifa
return
hr
;
}
desc
[
i
].
Width
=
mode
.
W
idth
;
desc
[
i
].
Height
=
mode
.
H
eight
;
desc
[
i
].
RefreshRate
.
Numerator
=
mode
.
RefreshR
ate
;
desc
[
i
].
Width
=
mode
.
w
idth
;
desc
[
i
].
Height
=
mode
.
h
eight
;
desc
[
i
].
RefreshRate
.
Numerator
=
mode
.
refresh_r
ate
;
desc
[
i
].
RefreshRate
.
Denominator
=
1
;
desc
[
i
].
Format
=
format
;
desc
[
i
].
ScanlineOrdering
=
DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED
;
/* FIXME */
...
...
dlls/wined3d/device.c
View file @
18a7653c
...
...
@@ -1586,16 +1586,16 @@ void CDECL wined3d_device_set_multithreaded(struct wined3d_device *device)
}
HRESULT
CDECL
wined3d_device_set_display_mode
(
struct
wined3d_device
*
device
,
UINT
swapchain_idx
,
const
WINED3DDISPLAYMODE
*
mode
)
UINT
swapchain_idx
,
const
struct
wined3d_display_mode
*
mode
)
{
struct
wined3d_adapter
*
adapter
=
device
->
adapter
;
const
struct
wined3d_format
*
format
=
wined3d_get_format
(
&
adapter
->
gl_info
,
mode
->
Format
);
const
struct
wined3d_format
*
format
=
wined3d_get_format
(
&
adapter
->
gl_info
,
mode
->
format_id
);
DEVMODEW
devmode
;
LONG
ret
;
RECT
clip_rc
;
TRACE
(
"device %p, swapchain_idx %u, mode %p (%ux%u@%u %s).
\n
"
,
device
,
swapchain_idx
,
mode
,
mode
->
Width
,
mode
->
Height
,
mode
->
RefreshRate
,
debug_d3dformat
(
mode
->
Format
));
mode
->
width
,
mode
->
height
,
mode
->
refresh_rate
,
debug_d3dformat
(
mode
->
format_id
));
/* Resize the screen even without a window:
* The app could have unset it with SetCooperativeLevel, but not called
...
...
@@ -1607,16 +1607,16 @@ HRESULT CDECL wined3d_device_set_display_mode(struct wined3d_device *device,
devmode
.
dmSize
=
sizeof
(
devmode
);
devmode
.
dmFields
=
DM_BITSPERPEL
|
DM_PELSWIDTH
|
DM_PELSHEIGHT
;
devmode
.
dmBitsPerPel
=
format
->
byte_count
*
CHAR_BIT
;
devmode
.
dmPelsWidth
=
mode
->
W
idth
;
devmode
.
dmPelsHeight
=
mode
->
H
eight
;
devmode
.
dmPelsWidth
=
mode
->
w
idth
;
devmode
.
dmPelsHeight
=
mode
->
h
eight
;
devmode
.
dmDisplayFrequency
=
mode
->
RefreshR
ate
;
if
(
mode
->
RefreshR
ate
)
devmode
.
dmDisplayFrequency
=
mode
->
refresh_r
ate
;
if
(
mode
->
refresh_r
ate
)
devmode
.
dmFields
|=
DM_DISPLAYFREQUENCY
;
/* Only change the mode if necessary */
if
(
adapter
->
screen_size
.
cx
==
mode
->
Width
&&
adapter
->
screen_size
.
cy
==
mode
->
H
eight
&&
adapter
->
screen_format
==
mode
->
Format
&&
!
mode
->
RefreshR
ate
)
if
(
adapter
->
screen_size
.
cx
==
mode
->
width
&&
adapter
->
screen_size
.
cy
==
mode
->
h
eight
&&
adapter
->
screen_format
==
mode
->
format_id
&&
!
mode
->
refresh_r
ate
)
return
WINED3D_OK
;
ret
=
ChangeDisplaySettingsExW
(
NULL
,
&
devmode
,
NULL
,
CDS_FULLSCREEN
,
NULL
);
...
...
@@ -1635,12 +1635,12 @@ HRESULT CDECL wined3d_device_set_display_mode(struct wined3d_device *device,
}
/* Store the new values */
adapter
->
screen_size
.
cx
=
mode
->
W
idth
;
adapter
->
screen_size
.
cy
=
mode
->
H
eight
;
adapter
->
screen_format
=
mode
->
Format
;
adapter
->
screen_size
.
cx
=
mode
->
w
idth
;
adapter
->
screen_size
.
cy
=
mode
->
h
eight
;
adapter
->
screen_format
=
mode
->
format_id
;
/* And finally clip mouse to our screen */
SetRect
(
&
clip_rc
,
0
,
0
,
mode
->
Width
,
mode
->
H
eight
);
SetRect
(
&
clip_rc
,
0
,
0
,
mode
->
width
,
mode
->
h
eight
);
ClipCursor
(
&
clip_rc
);
return
WINED3D_OK
;
...
...
@@ -3882,7 +3882,7 @@ HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device
}
HRESULT
CDECL
wined3d_device_get_display_mode
(
const
struct
wined3d_device
*
device
,
UINT
swapchain_idx
,
WINED3DDISPLAYMODE
*
mode
)
UINT
swapchain_idx
,
struct
wined3d_display_mode
*
mode
)
{
struct
wined3d_swapchain
*
swapchain
;
HRESULT
hr
;
...
...
@@ -3909,10 +3909,10 @@ HRESULT CDECL wined3d_device_get_display_mode(const struct wined3d_device *devic
*
* Also don't relay to the swapchain because with ddraw it's possible
* that there isn't a swapchain at all. */
mode
->
W
idth
=
adapter
->
screen_size
.
cx
;
mode
->
H
eight
=
adapter
->
screen_size
.
cy
;
mode
->
Format
=
adapter
->
screen_format
;
mode
->
RefreshR
ate
=
0
;
mode
->
w
idth
=
adapter
->
screen_size
.
cx
;
mode
->
h
eight
=
adapter
->
screen_size
.
cy
;
mode
->
format_id
=
adapter
->
screen_format
;
mode
->
refresh_r
ate
=
0
;
hr
=
WINED3D_OK
;
}
...
...
@@ -5269,8 +5269,8 @@ static HRESULT updateSurfaceDesc(struct wined3d_surface *surface,
static
BOOL
is_display_mode_supported
(
const
struct
wined3d_device
*
device
,
const
WINED3DPRESENT_PARAMETERS
*
pp
)
{
struct
wined3d_display_mode
m
;
UINT
i
,
count
;
WINED3DDISPLAYMODE
m
;
HRESULT
hr
;
/* All Windowed modes are supported, as is leaving the current mode */
...
...
@@ -5285,7 +5285,7 @@ static BOOL is_display_mode_supported(const struct wined3d_device *device, const
hr
=
wined3d_enum_adapter_modes
(
device
->
wined3d
,
device
->
adapter
->
ordinal
,
WINED3DFMT_UNKNOWN
,
i
,
&
m
);
if
(
FAILED
(
hr
))
ERR
(
"Failed to enumerate adapter mode.
\n
"
);
if
(
m
.
Width
==
pp
->
BackBufferWidth
&&
m
.
H
eight
==
pp
->
BackBufferHeight
)
if
(
m
.
width
==
pp
->
BackBufferWidth
&&
m
.
h
eight
==
pp
->
BackBufferHeight
)
/* Mode found, it is supported. */
return
TRUE
;
}
...
...
@@ -5416,9 +5416,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
{
struct
wined3d_resource
*
resource
,
*
cursor
;
struct
wined3d_swapchain
*
swapchain
;
struct
wined3d_display_mode
mode
;
BOOL
DisplayModeChanged
=
FALSE
;
BOOL
update_desc
=
FALSE
;
WINED3DDISPLAYMODE
mode
;
unsigned
int
i
;
HRESULT
hr
;
...
...
@@ -5544,17 +5544,17 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
if
(
present_parameters
->
Windowed
)
{
mode
.
W
idth
=
swapchain
->
orig_width
;
mode
.
H
eight
=
swapchain
->
orig_height
;
mode
.
RefreshR
ate
=
0
;
mode
.
Format
=
swapchain
->
presentParms
.
BackBufferFormat
;
mode
.
w
idth
=
swapchain
->
orig_width
;
mode
.
h
eight
=
swapchain
->
orig_height
;
mode
.
refresh_r
ate
=
0
;
mode
.
format_id
=
swapchain
->
presentParms
.
BackBufferFormat
;
}
else
{
mode
.
W
idth
=
present_parameters
->
BackBufferWidth
;
mode
.
H
eight
=
present_parameters
->
BackBufferHeight
;
mode
.
RefreshR
ate
=
present_parameters
->
FullScreen_RefreshRateInHz
;
mode
.
Format
=
swapchain
->
presentParms
.
BackBufferFormat
;
mode
.
w
idth
=
present_parameters
->
BackBufferWidth
;
mode
.
h
eight
=
present_parameters
->
BackBufferHeight
;
mode
.
refresh_r
ate
=
present_parameters
->
FullScreen_RefreshRateInHz
;
mode
.
format_id
=
swapchain
->
presentParms
.
BackBufferFormat
;
}
/* Should Width == 800 && Height == 0 set 800x600? */
...
...
@@ -5893,9 +5893,9 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
{
struct
wined3d_adapter
*
adapter
=
&
wined3d
->
adapters
[
adapter_idx
];
const
struct
fragment_pipeline
*
fragment_pipeline
;
struct
wined3d_display_mode
mode
;
struct
shader_caps
shader_caps
;
struct
fragment_caps
ffp_caps
;
WINED3DDISPLAYMODE
mode
;
unsigned
int
i
;
HRESULT
hr
;
...
...
@@ -5916,9 +5916,9 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
wined3d_decref
(
device
->
wined3d
);
return
hr
;
}
adapter
->
screen_size
.
cx
=
mode
.
W
idth
;
adapter
->
screen_size
.
cy
=
mode
.
H
eight
;
adapter
->
screen_format
=
mode
.
Format
;
adapter
->
screen_size
.
cx
=
mode
.
w
idth
;
adapter
->
screen_size
.
cy
=
mode
.
h
eight
;
adapter
->
screen_format
=
mode
.
format_id
;
/* Save the creation parameters. */
device
->
createParms
.
AdapterOrdinal
=
adapter_idx
;
...
...
dlls/wined3d/directx.c
View file @
18a7653c
...
...
@@ -2903,7 +2903,7 @@ UINT CDECL wined3d_get_adapter_mode_count(const struct wined3d *wined3d, UINT ad
/* Note: dx9 supplies a format. Calls from d3d8 supply WINED3DFMT_UNKNOWN */
HRESULT
CDECL
wined3d_enum_adapter_modes
(
const
struct
wined3d
*
wined3d
,
UINT
adapter_idx
,
enum
wined3d_format_id
format_id
,
UINT
mode_idx
,
WINED3DDISPLAYMODE
*
mode
)
enum
wined3d_format_id
format_id
,
UINT
mode_idx
,
struct
wined3d_display_mode
*
mode
)
{
TRACE_
(
d3d_caps
)(
"wined3d %p, adapter_idx %u, format %s, mode_idx %u, mode %p.
\n
"
,
wined3d
,
adapter_idx
,
debug_d3dformat
(
format_id
),
mode_idx
,
mode
);
...
...
@@ -2954,16 +2954,16 @@ HRESULT CDECL wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT ada
/* Now get the display mode via the calculated index */
if
(
EnumDisplaySettingsExW
(
NULL
,
ModeIdx
,
&
DevModeW
,
0
))
{
mode
->
W
idth
=
DevModeW
.
dmPelsWidth
;
mode
->
H
eight
=
DevModeW
.
dmPelsHeight
;
mode
->
RefreshR
ate
=
DEFAULT_REFRESH_RATE
;
mode
->
w
idth
=
DevModeW
.
dmPelsWidth
;
mode
->
h
eight
=
DevModeW
.
dmPelsHeight
;
mode
->
refresh_r
ate
=
DEFAULT_REFRESH_RATE
;
if
(
DevModeW
.
dmFields
&
DM_DISPLAYFREQUENCY
)
mode
->
RefreshR
ate
=
DevModeW
.
dmDisplayFrequency
;
mode
->
refresh_r
ate
=
DevModeW
.
dmDisplayFrequency
;
if
(
format_id
==
WINED3DFMT_UNKNOWN
)
mode
->
Format
=
pixelformat_for_depth
(
DevModeW
.
dmBitsPerPel
);
mode
->
format_id
=
pixelformat_for_depth
(
DevModeW
.
dmBitsPerPel
);
else
mode
->
Format
=
format_id
;
mode
->
format_id
=
format_id
;
}
else
{
...
...
@@ -2972,8 +2972,8 @@ HRESULT CDECL wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT ada
}
TRACE_
(
d3d_caps
)(
"W %d H %d rr %d fmt (%x - %s) bpp %u
\n
"
,
mode
->
Width
,
mode
->
Height
,
mode
->
RefreshRate
,
mode
->
Format
,
debug_d3dformat
(
mode
->
Format
),
DevModeW
.
dmBitsPerPel
);
mode
->
width
,
mode
->
height
,
mode
->
refresh_rate
,
mode
->
format_id
,
debug_d3dformat
(
mode
->
format_id
),
DevModeW
.
dmBitsPerPel
);
}
else
{
...
...
@@ -2984,7 +2984,7 @@ HRESULT CDECL wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT ada
}
HRESULT
CDECL
wined3d_get_adapter_display_mode
(
const
struct
wined3d
*
wined3d
,
UINT
adapter_idx
,
WINED3DDISPLAYMODE
*
mode
)
struct
wined3d_display_mode
*
mode
)
{
TRACE
(
"wined3d %p, adapter_idx %u, display_mode %p.
\n
"
,
wined3d
,
adapter_idx
,
mode
);
...
...
@@ -3000,21 +3000,21 @@ HRESULT CDECL wined3d_get_adapter_display_mode(const struct wined3d *wined3d, UI
DevModeW
.
dmSize
=
sizeof
(
DevModeW
);
EnumDisplaySettingsExW
(
NULL
,
ENUM_CURRENT_SETTINGS
,
&
DevModeW
,
0
);
mode
->
W
idth
=
DevModeW
.
dmPelsWidth
;
mode
->
H
eight
=
DevModeW
.
dmPelsHeight
;
mode
->
w
idth
=
DevModeW
.
dmPelsWidth
;
mode
->
h
eight
=
DevModeW
.
dmPelsHeight
;
bpp
=
DevModeW
.
dmBitsPerPel
;
mode
->
RefreshR
ate
=
DEFAULT_REFRESH_RATE
;
if
(
DevModeW
.
dmFields
&
DM_DISPLAYFREQUENCY
)
mode
->
RefreshR
ate
=
DevModeW
.
dmDisplayFrequency
;
mode
->
Format
=
pixelformat_for_depth
(
bpp
);
mode
->
refresh_r
ate
=
DEFAULT_REFRESH_RATE
;
if
(
DevModeW
.
dmFields
&
DM_DISPLAYFREQUENCY
)
mode
->
refresh_r
ate
=
DevModeW
.
dmDisplayFrequency
;
mode
->
format_id
=
pixelformat_for_depth
(
bpp
);
}
else
{
FIXME_
(
d3d_caps
)(
"Adapter not primary display
\n
"
);
}
TRACE_
(
d3d_caps
)(
"returning w:%d, h:%d, ref:%d, fmt:%s
\n
"
,
mode
->
W
idth
,
mode
->
Height
,
mode
->
RefreshRate
,
debug_d3dformat
(
mode
->
Format
));
TRACE_
(
d3d_caps
)(
"returning w:%d, h:%d, ref:%d, fmt:%s
\n
"
,
mode
->
w
idth
,
mode
->
height
,
mode
->
refresh_rate
,
debug_d3dformat
(
mode
->
format_id
));
return
WINED3D_OK
;
}
...
...
dlls/wined3d/swapchain.c
View file @
18a7653c
...
...
@@ -29,7 +29,7 @@ WINE_DECLARE_DEBUG_CHANNEL(fps);
/* Do not call while under the GL lock. */
static
void
swapchain_cleanup
(
struct
wined3d_swapchain
*
swapchain
)
{
WINED3DDISPLAYMODE
mode
;
struct
wined3d_display_mode
mode
;
UINT
i
;
TRACE
(
"Destroying swapchain %p.
\n
"
,
swapchain
);
...
...
@@ -74,10 +74,10 @@ static void swapchain_cleanup(struct wined3d_swapchain *swapchain)
* orig_height will be equal to the modes in the presentation params. */
if
(
!
swapchain
->
presentParms
.
Windowed
&&
swapchain
->
presentParms
.
AutoRestoreDisplayMode
)
{
mode
.
W
idth
=
swapchain
->
orig_width
;
mode
.
H
eight
=
swapchain
->
orig_height
;
mode
.
RefreshR
ate
=
0
;
mode
.
Format
=
swapchain
->
orig_fmt
;
mode
.
w
idth
=
swapchain
->
orig_width
;
mode
.
h
eight
=
swapchain
->
orig_height
;
mode
.
refresh_r
ate
=
0
;
mode
.
format_id
=
swapchain
->
orig_fmt
;
wined3d_device_set_display_mode
(
swapchain
->
device
,
0
,
&
mode
);
}
...
...
@@ -221,7 +221,8 @@ HRESULT CDECL wined3d_swapchain_get_raster_status(const struct wined3d_swapchain
return
WINED3DERR_INVALIDCALL
;
}
HRESULT
CDECL
wined3d_swapchain_get_display_mode
(
const
struct
wined3d_swapchain
*
swapchain
,
WINED3DDISPLAYMODE
*
mode
)
HRESULT
CDECL
wined3d_swapchain_get_display_mode
(
const
struct
wined3d_swapchain
*
swapchain
,
struct
wined3d_display_mode
*
mode
)
{
HRESULT
hr
;
...
...
@@ -230,7 +231,7 @@ HRESULT CDECL wined3d_swapchain_get_display_mode(const struct wined3d_swapchain
hr
=
wined3d_get_adapter_display_mode
(
swapchain
->
device
->
wined3d
,
swapchain
->
device
->
adapter
->
ordinal
,
mode
);
TRACE
(
"Returning w %u, h %u, refresh rate %u, format %s.
\n
"
,
mode
->
Width
,
mode
->
Height
,
mode
->
RefreshRate
,
debug_d3dformat
(
mode
->
Format
));
mode
->
width
,
mode
->
height
,
mode
->
refresh_rate
,
debug_d3dformat
(
mode
->
format_id
));
return
hr
;
}
...
...
@@ -828,8 +829,8 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTY
{
const
struct
wined3d_adapter
*
adapter
=
device
->
adapter
;
const
struct
wined3d_format
*
format
;
struct
wined3d_display_mode
mode
;
BOOL
displaymode_set
=
FALSE
;
WINED3DDISPLAYMODE
mode
;
RECT
client_rect
;
HWND
window
;
HRESULT
hr
;
...
...
@@ -873,10 +874,10 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTY
swapchain
->
device_window
=
window
;
wined3d_get_adapter_display_mode
(
device
->
wined3d
,
adapter
->
ordinal
,
&
mode
);
swapchain
->
orig_width
=
mode
.
W
idth
;
swapchain
->
orig_height
=
mode
.
H
eight
;
swapchain
->
orig_fmt
=
mode
.
Format
;
format
=
wined3d_get_format
(
&
adapter
->
gl_info
,
mode
.
Format
);
swapchain
->
orig_width
=
mode
.
w
idth
;
swapchain
->
orig_height
=
mode
.
h
eight
;
swapchain
->
orig_fmt
=
mode
.
format_id
;
format
=
wined3d_get_format
(
&
adapter
->
gl_info
,
mode
.
format_id
);
GetClientRect
(
window
,
&
client_rect
);
if
(
present_parameters
->
Windowed
...
...
@@ -929,13 +930,13 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTY
if
(
!
present_parameters
->
Windowed
)
{
WINED3DDISPLAYMODE
mode
;
struct
wined3d_display_mode
mode
;
/* Change the display settings */
mode
.
W
idth
=
present_parameters
->
BackBufferWidth
;
mode
.
H
eight
=
present_parameters
->
BackBufferHeight
;
mode
.
Format
=
present_parameters
->
BackBufferFormat
;
mode
.
RefreshR
ate
=
present_parameters
->
FullScreen_RefreshRateInHz
;
mode
.
w
idth
=
present_parameters
->
BackBufferWidth
;
mode
.
h
eight
=
present_parameters
->
BackBufferHeight
;
mode
.
format_id
=
present_parameters
->
BackBufferFormat
;
mode
.
refresh_r
ate
=
present_parameters
->
FullScreen_RefreshRateInHz
;
hr
=
wined3d_device_set_display_mode
(
device
,
0
,
&
mode
);
if
(
FAILED
(
hr
))
...
...
include/wine/wined3d.h
View file @
18a7653c
...
...
@@ -1509,13 +1509,13 @@ enum wined3d_sysval_semantic
#define WINEDDPCAPS_2BIT 0x00000200
#define WINEDDPCAPS_ALPHA 0x00000400
typedef
struct
_WINED3DDISPLAYMODE
struct
wined3d_display_mode
{
UINT
W
idth
;
UINT
H
eight
;
UINT
RefreshR
ate
;
enum
wined3d_format_id
Format
;
}
WINED3DDISPLAYMODE
;
UINT
w
idth
;
UINT
h
eight
;
UINT
refresh_r
ate
;
enum
wined3d_format_id
format_id
;
};
struct
wined3d_color
{
...
...
@@ -2121,10 +2121,10 @@ HRESULT __cdecl wined3d_check_device_type(const struct wined3d *wined3d, UINT ad
struct
wined3d
*
__cdecl
wined3d_create
(
UINT
dxVersion
,
DWORD
flags
,
void
*
parent
);
ULONG
__cdecl
wined3d_decref
(
struct
wined3d
*
wined3d
);
HRESULT
__cdecl
wined3d_enum_adapter_modes
(
const
struct
wined3d
*
wined3d
,
UINT
adapter_idx
,
enum
wined3d_format_id
format_id
,
UINT
mode_idx
,
WINED3DDISPLAYMODE
*
mode
);
enum
wined3d_format_id
format_id
,
UINT
mode_idx
,
struct
wined3d_display_mode
*
mode
);
UINT
__cdecl
wined3d_get_adapter_count
(
const
struct
wined3d
*
wined3d
);
HRESULT
__cdecl
wined3d_get_adapter_display_mode
(
const
struct
wined3d
*
wined3d
,
UINT
adapter_idx
,
WINED3DDISPLAYMODE
*
mode
);
struct
wined3d_display_mode
*
mode
);
HRESULT
__cdecl
wined3d_get_adapter_identifier
(
const
struct
wined3d
*
wined3d
,
UINT
adapter_idx
,
DWORD
flags
,
WINED3DADAPTER_IDENTIFIER
*
identifier
);
UINT
__cdecl
wined3d_get_adapter_mode_count
(
const
struct
wined3d
*
wined3d
,
...
...
@@ -2207,7 +2207,7 @@ HRESULT __cdecl wined3d_device_get_depth_stencil(const struct wined3d_device *de
struct
wined3d_surface
**
depth_stencil
);
HRESULT
__cdecl
wined3d_device_get_device_caps
(
const
struct
wined3d_device
*
device
,
WINED3DCAPS
*
caps
);
HRESULT
__cdecl
wined3d_device_get_display_mode
(
const
struct
wined3d_device
*
device
,
UINT
swapchain_idx
,
WINED3DDISPLAYMODE
*
mode
);
UINT
swapchain_idx
,
struct
wined3d_display_mode
*
mode
);
HRESULT
__cdecl
wined3d_device_get_front_buffer_data
(
const
struct
wined3d_device
*
device
,
UINT
swapchain_idx
,
struct
wined3d_surface
*
dst_surface
);
void
__cdecl
wined3d_device_get_gamma_ramp
(
const
struct
wined3d_device
*
device
,
...
...
@@ -2287,7 +2287,7 @@ HRESULT __cdecl wined3d_device_set_cursor_properties(struct wined3d_device *devi
HRESULT
__cdecl
wined3d_device_set_depth_stencil
(
struct
wined3d_device
*
device
,
struct
wined3d_surface
*
depth_stencil
);
HRESULT
__cdecl
wined3d_device_set_dialog_box_mode
(
struct
wined3d_device
*
device
,
BOOL
enable_dialogs
);
HRESULT
__cdecl
wined3d_device_set_display_mode
(
struct
wined3d_device
*
device
,
UINT
swapchain_idx
,
const
WINED3DDISPLAYMODE
*
mode
);
UINT
swapchain_idx
,
const
struct
wined3d_display_mode
*
mode
);
void
__cdecl
wined3d_device_set_gamma_ramp
(
const
struct
wined3d_device
*
device
,
UINT
swapchain_idx
,
DWORD
flags
,
const
WINED3DGAMMARAMP
*
ramp
);
HRESULT
__cdecl
wined3d_device_set_index_buffer
(
struct
wined3d_device
*
device
,
...
...
@@ -2451,7 +2451,7 @@ HRESULT __cdecl wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain
UINT
backbuffer_idx
,
WINED3DBACKBUFFER_TYPE
backbuffer_type
,
struct
wined3d_surface
**
backbuffer
);
struct
wined3d_device
*
__cdecl
wined3d_swapchain_get_device
(
const
struct
wined3d_swapchain
*
swapchain
);
HRESULT
__cdecl
wined3d_swapchain_get_display_mode
(
const
struct
wined3d_swapchain
*
swapchain
,
WINED3DDISPLAYMODE
*
mode
);
struct
wined3d_display_mode
*
mode
);
HRESULT
__cdecl
wined3d_swapchain_get_front_buffer_data
(
const
struct
wined3d_swapchain
*
swapchain
,
struct
wined3d_surface
*
dst_surface
);
HRESULT
__cdecl
wined3d_swapchain_get_gamma_ramp
(
const
struct
wined3d_swapchain
*
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