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
7f10ee45
Commit
7f10ee45
authored
Dec 06, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Dec 11, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use the adapter to read the display mode.
parent
cff26595
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
44 deletions
+23
-44
device.c
dlls/wined3d/device.c
+10
-17
directx.c
dlls/wined3d/directx.c
+7
-6
swapchain.c
dlls/wined3d/swapchain.c
+5
-21
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/device.c
View file @
7f10ee45
...
...
@@ -1402,6 +1402,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic
HRESULT
hr
=
WINED3D_OK
;
IUnknown
*
bufferParent
;
BOOL
displaymode_set
=
FALSE
;
WINED3DDISPLAYMODE
Mode
;
const
StaticPixelFormatDesc
*
formatDesc
;
TRACE
(
"(%p) : Created Aditional Swap Chain
\n
"
,
This
);
...
...
@@ -1439,10 +1441,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic
return
WINED3DERR_NOTAVAILABLE
;
}
object
->
orig_width
=
GetSystemMetrics
(
SM_CXSCREEN
);
object
->
orig_height
=
GetSystemMetrics
(
SM_CYSCREEN
);
object
->
orig_fmt
=
pixelformat_for_depth
(
GetDeviceCaps
(
hDc
,
BITSPIXEL
)
*
GetDeviceCaps
(
hDc
,
PLANES
));
ReleaseDC
(
object
->
win_handle
,
hDc
);
/* Get info on the current display setup */
IWineD3D_GetAdapterDisplayMode
(
This
->
wineD3D
,
This
->
adapter
->
num
,
&
Mode
);
object
->
orig_width
=
Mode
.
Width
;
object
->
orig_height
=
Mode
.
Height
;
object
->
orig_fmt
=
Mode
.
Format
;
formatDesc
=
getFormatDescEntry
(
Mode
.
Format
,
NULL
,
NULL
);
/** MSDN: If Windowed is TRUE and either of the BackBufferWidth/Height values is zero,
* then the corresponding dimension of the client area of the hDeviceWindow
...
...
@@ -1507,14 +1511,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic
if
(
!
pPresentationParameters
->
Windowed
)
{
DEVMODEW
devmode
;
HDC
hdc
;
int
bpp
=
0
;
RECT
clip_rc
;
/* Get info on the current display setup */
hdc
=
GetDC
(
0
);
bpp
=
GetDeviceCaps
(
hdc
,
BITSPIXEL
);
ReleaseDC
(
0
,
hdc
);
bpp
=
formatDesc
->
bpp
*
8
;
/* Change the display settings */
memset
(
&
devmode
,
0
,
sizeof
(
devmode
));
...
...
@@ -1641,23 +1641,16 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic
error:
if
(
displaymode_set
)
{
DEVMODEW
devmode
;
HDC
hdc
;
int
bpp
=
0
;
RECT
clip_rc
;
SetRect
(
&
clip_rc
,
0
,
0
,
object
->
orig_width
,
object
->
orig_height
);
ClipCursor
(
NULL
);
/* Get info on the current display setup */
hdc
=
GetDC
(
0
);
bpp
=
GetDeviceCaps
(
hdc
,
BITSPIXEL
);
ReleaseDC
(
0
,
hdc
);
/* Change the display settings */
memset
(
&
devmode
,
0
,
sizeof
(
devmode
));
devmode
.
dmSize
=
sizeof
(
devmode
);
devmode
.
dmFields
=
DM_BITSPERPEL
|
DM_PELSWIDTH
|
DM_PELSHEIGHT
;
devmode
.
dmBitsPerPel
=
(
bpp
>=
24
)
?
32
:
bpp
;
/* Stupid XVidMode cannot change bpp */
devmode
.
dmBitsPerPel
=
(
formatDesc
->
bpp
>=
3
)
?
32
:
formatDesc
->
bpp
*
8
;
/* Stupid XVidMode cannot change bpp */
devmode
.
dmPelsWidth
=
object
->
orig_width
;
devmode
.
dmPelsHeight
=
object
->
orig_height
;
ChangeDisplaySettingsExW
(
This
->
adapter
->
DeviceName
,
&
devmode
,
NULL
,
CDS_FULLSCREEN
,
NULL
);
...
...
dlls/wined3d/directx.c
View file @
7f10ee45
...
...
@@ -2698,7 +2698,7 @@ static HRESULT WINAPI IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT Adapter,
IWineD3DDeviceImpl
*
object
=
NULL
;
IWineD3DImpl
*
This
=
(
IWineD3DImpl
*
)
iface
;
HDC
hDC
;
WINED3DDISPLAYMODE
mode
;
int
i
;
/* Validate the adapter number. If no adapters are available(no GL), ignore the adapter
...
...
@@ -2762,11 +2762,11 @@ static HRESULT WINAPI IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT Adapter,
object
->
state
=
WINED3D_OK
;
/* Get the initial screen setup for ddraw */
object
->
ddraw_width
=
GetSystemMetrics
(
SM_CXSCREEN
);
object
->
ddraw_height
=
GetSystemMetrics
(
SM_CYSCREEN
);
hDC
=
GetDC
(
0
)
;
object
->
ddraw_
format
=
pixelformat_for_depth
(
GetDeviceCaps
(
hDC
,
BITSPIXEL
)
*
GetDeviceCaps
(
hDC
,
PLANES
))
;
ReleaseDC
(
0
,
hDC
)
;
IWineD3DImpl_GetAdapterDisplayMode
(
iface
,
Adapter
,
&
mode
);
object
->
ddraw_width
=
mode
.
Width
;
object
->
ddraw_
height
=
mode
.
Height
;
object
->
ddraw_format
=
mode
.
Format
;
for
(
i
=
0
;
i
<
PATCHMAP_SIZE
;
i
++
)
{
list_init
(
&
object
->
patches
[
i
]);
...
...
@@ -2933,6 +2933,7 @@ BOOL InitAdapters(void) {
HDC
hdc
;
TRACE
(
"Initializing default adapter
\n
"
);
Adapters
[
0
].
num
=
0
;
Adapters
[
0
].
monitorPoint
.
x
=
-
1
;
Adapters
[
0
].
monitorPoint
.
y
=
-
1
;
...
...
dlls/wined3d/swapchain.c
View file @
7f10ee45
...
...
@@ -464,30 +464,14 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_GetRasterStatus(IWineD3DSwapChain *i
static
HRESULT
WINAPI
IWineD3DSwapChainImpl_GetDisplayMode
(
IWineD3DSwapChain
*
iface
,
WINED3DDISPLAYMODE
*
pMode
)
{
IWineD3DSwapChainImpl
*
This
=
(
IWineD3DSwapChainImpl
*
)
iface
;
HDC
hdc
;
int
bpp
=
0
;
pMode
->
Width
=
GetSystemMetrics
(
SM_CXSCREEN
);
pMode
->
Height
=
GetSystemMetrics
(
SM_CYSCREEN
);
pMode
->
RefreshRate
=
85
;
/* FIXME: How to identify? */
hdc
=
GetDC
(
0
);
bpp
=
GetDeviceCaps
(
hdc
,
BITSPIXEL
);
ReleaseDC
(
0
,
hdc
);
switch
(
bpp
)
{
case
8
:
pMode
->
Format
=
WINED3DFMT_R8G8B8
;
break
;
case
16
:
pMode
->
Format
=
WINED3DFMT_R5G6B5
;
break
;
case
24
:
/*pMode->Format = WINED3DFMT_R8G8B8; break; */
/* 32bpp and 24bpp can be aliased for X */
case
32
:
pMode
->
Format
=
WINED3DFMT_A8R8G8B8
;
break
;
default
:
FIXME
(
"Unrecognized display mode format
\n
"
);
pMode
->
Format
=
WINED3DFMT_UNKNOWN
;
}
HRESULT
hr
;
TRACE
(
"(%p)->(%p): Calling GetAdapterDisplayMode
\n
"
,
This
,
pMode
);
hr
=
IWineD3D_GetAdapterDisplayMode
(
This
->
wineD3DDevice
->
wineD3D
,
This
->
wineD3DDevice
->
adapter
->
num
,
pMode
);
TRACE
(
"(%p) : returning w(%d) h(%d) rr(%d) fmt(%u,%s)
\n
"
,
This
,
pMode
->
Width
,
pMode
->
Height
,
pMode
->
RefreshRate
,
pMode
->
Format
,
debug_d3dformat
(
pMode
->
Format
));
return
WINED3D_OK
;
return
hr
;
}
static
HRESULT
WINAPI
IWineD3DSwapChainImpl_GetDevice
(
IWineD3DSwapChain
*
iface
,
IWineD3DDevice
**
ppDevice
)
{
...
...
dlls/wined3d/wined3d_private.h
View file @
7f10ee45
...
...
@@ -574,6 +574,7 @@ typedef struct WineD3D_PixelFormat
typedef
struct
GLPixelFormatDesc
GLPixelFormatDesc
;
struct
WineD3DAdapter
{
UINT
num
;
POINT
monitorPoint
;
WineD3D_GL_Info
gl_info
;
const
char
*
driver
;
...
...
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