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
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
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
97 additions
and
95 deletions
+97
-95
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
+0
-0
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
This diff is collapsed.
Click to expand it.
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