mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
Add support for borderless mode
This commit is contained in:
parent
83fba414d4
commit
921684fed8
21
main.c
21
main.c
@ -212,7 +212,14 @@ HRESULT __stdcall ddraw_SetDisplayMode(IDirectDrawImpl *This, DWORD width, DWORD
|
|||||||
{
|
{
|
||||||
if(!This->windowed_init)
|
if(!This->windowed_init)
|
||||||
{
|
{
|
||||||
SetWindowLong(This->hWnd, GWL_STYLE, GetWindowLong(This->hWnd, GWL_STYLE) | WS_CAPTION | WS_BORDER | WS_SYSMENU | WS_MINIMIZEBOX);
|
if (!This->border)
|
||||||
|
{
|
||||||
|
SetWindowLong(This->hWnd, GWL_STYLE, GetWindowLong(This->hWnd, GWL_STYLE) & ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetWindowLong(This->hWnd, GWL_STYLE, GetWindowLong(This->hWnd, GWL_STYLE) | WS_CAPTION | WS_BORDER | WS_SYSMENU | WS_MINIMIZEBOX);
|
||||||
|
}
|
||||||
|
|
||||||
/* center the window with correct dimensions */
|
/* center the window with correct dimensions */
|
||||||
int x = (This->mode.dmPelsWidth / 2) - (This->render.width / 2);
|
int x = (This->mode.dmPelsWidth / 2) - (This->render.width / 2);
|
||||||
@ -592,6 +599,8 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk
|
|||||||
"; bits per pixel, possible values: 16, 24 and 32, 0 = auto\n"
|
"; bits per pixel, possible values: 16, 24 and 32, 0 = auto\n"
|
||||||
"bpp=0\n"
|
"bpp=0\n"
|
||||||
"windowed=true\n"
|
"windowed=true\n"
|
||||||
|
"; show window borders in windowed mode\n"
|
||||||
|
"border=true\n"
|
||||||
"; real rendering rate, -1 = screen rate, 0 = unlimited, n = cap\n"
|
"; real rendering rate, -1 = screen rate, 0 = unlimited, n = cap\n"
|
||||||
"maxfps=0\n"
|
"maxfps=0\n"
|
||||||
"; vertical synchronization, enable if you get tearing (OpenGL only)\n"
|
"; vertical synchronization, enable if you get tearing (OpenGL only)\n"
|
||||||
@ -622,6 +631,16 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk
|
|||||||
This->windowed = TRUE;
|
This->windowed = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GetPrivateProfileStringA("ddraw", "border", "TRUE", tmp, sizeof(tmp), ini_path);
|
||||||
|
if(tolower(tmp[0]) == 'n' || tolower(tmp[0]) == 'f' || tmp[0] == '0')
|
||||||
|
{
|
||||||
|
This->border = FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
This->border = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
This->render.maxfps = GetPrivateProfileIntA("ddraw", "maxfps", 0, ini_path);
|
This->render.maxfps = GetPrivateProfileIntA("ddraw", "maxfps", 0, ini_path);
|
||||||
This->render.width = GetPrivateProfileIntA("ddraw", "width", 640, ini_path);
|
This->render.width = GetPrivateProfileIntA("ddraw", "width", 640, ini_path);
|
||||||
if(This->render.width < 640)
|
if(This->render.width < 640)
|
||||||
|
1
main.h
1
main.h
@ -38,6 +38,7 @@ typedef struct IDirectDrawImpl
|
|||||||
DWORD height;
|
DWORD height;
|
||||||
DWORD bpp;
|
DWORD bpp;
|
||||||
BOOL windowed;
|
BOOL windowed;
|
||||||
|
BOOL border;
|
||||||
BOOL windowed_init;
|
BOOL windowed_init;
|
||||||
DEVMODE mode;
|
DEVMODE mode;
|
||||||
struct IDirectDrawSurfaceImpl *primary;
|
struct IDirectDrawSurfaceImpl *primary;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user