DXGL r895 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r894
|
r895
|
r896
>
Date:
01:40, 4 March 2019
Author:
admin
Status:
new
Tags:
Comment:
Support window mode on multiple monitors, when primary monitor is at coordinates 0,0
Modified paths:
/ddraw/glDirectDraw.cpp
(modified) (
history
)
/ddraw/glDirectDrawSurface.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glDirectDraw.cpp
—
—
@@ -1797,6 +1797,9 @@
1798
1798
if(hWnd && !IsWindow(hWnd)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
1799
1799
if ((dwFlags & DDSCL_EXCLUSIVE) && !hWnd) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
1800
1800
if(dwFlags & 0xFFFFE020) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
1801
+ DWORD winver = GetVersion();
1802
+ DWORD winvermajor = (DWORD)(LOBYTE(LOWORD(winver)));
1803
+ DWORD winverminor = (DWORD)(HIBYTE(LOWORD(winver)));
1801
1804
/*if (((hWnd != this->hWnd) && this->hWnd) || (this->hWnd && (dwFlags & DDSCL_NORMAL)))
1802
1805
{
1803
1806
if (winstyle)
—
—
@@ -1877,8 +1880,16 @@
1878
1881
GetClientRect(hWnd,&rect);
1879
1882
x = rect.right - rect.left;
1880
1883
y = rect.bottom - rect.top;
1881
- internalx = screenx = primaryx = devmode.dmPelsWidth;
1882
- internaly = screeny = primaryy = devmode.dmPelsHeight;
1884
+ if ((winvermajor > 4) || ((winvermajor == 4) && (winverminor >= 1)))
1885
+ {
1886
+ internalx = screenx = primaryx = GetSystemMetrics(SM_CXVIRTUALSCREEN);
1887
+ internaly = screeny = primaryy = GetSystemMetrics(SM_CYVIRTUALSCREEN);
1888
+ }
1889
+ else
1890
+ {
1891
+ internalx = screenx = primaryx = devmode.dmPelsWidth;
1892
+ internaly = screeny = primaryy = devmode.dmPelsHeight;
1893
+ }
1883
1894
}
1884
1895
bpp = devmode.dmBitsPerPel;
1885
1896
internalrefresh = primaryrefresh = screenrefresh = devmode.dmDisplayFrequency;
Index: ddraw/glDirectDrawSurface.cpp
—
—
@@ -75,6 +75,7 @@
76
76
LONG sizes[6];
77
77
int i;
78
78
float xscale, yscale;
79
+ DWORD winver, winvermajor, winverminor;
79
80
ddInterface->GetSizes(sizes);
80
81
if(ddsd.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
81
82
{
—
—
@@ -184,8 +185,19 @@
185
186
}
186
187
else
187
188
{
188
- fakex = ddsd.dwWidth = GetSystemMetrics(SM_CXSCREEN);
189
- fakey = ddsd.dwHeight = GetSystemMetrics(SM_CYSCREEN);
189
+ winver = GetVersion();
190
+ winvermajor = (DWORD)(LOBYTE(LOWORD(winver)));
191
+ winverminor = (DWORD)(HIBYTE(LOWORD(winver)));
192
+ if ((winvermajor > 4) || ((winvermajor == 4) && (winverminor >= 1)))
193
+ {
194
+ fakex = ddsd.dwWidth = GetSystemMetrics(SM_CXVIRTUALSCREEN);
195
+ fakey = ddsd.dwHeight = GetSystemMetrics(SM_CYVIRTUALSCREEN);
196
+ }
197
+ else
198
+ {
199
+ fakex = ddsd.dwWidth = GetSystemMetrics(SM_CXSCREEN);
200
+ fakey = ddsd.dwHeight = GetSystemMetrics(SM_CYSCREEN);
201
+ }
190
202
ddsd.dwFlags |= (DDSD_WIDTH | DDSD_HEIGHT);
191
203
*error = DD_OK;
192
204
}
Navigation menu
Personal tools
Log in
Namespaces
Special page
English
expanded
collapsed
Views
More
expanded
collapsed
Search
Navigation
Home
Main page
Recent changes
Random page
MediaWiki help
Introduction
Progress
Downloads
Source code
Build from source
AppDB
Bug reports
Forums
Tools
Special pages
Printable version