-
Notifications
You must be signed in to change notification settings - Fork 74
Add "-noborder" launch argument for borderless windowed mode #327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,7 @@ | |
HINSTANCE ApplicationHInstance = NULL; ///< our application instance | ||
HWND ApplicationHWnd = NULL; ///< our application window handle | ||
Bool ApplicationIsWindowed = false; | ||
Bool ApplicationIsBorderless = false; // TheSuperHackers @feature @ShizCalev 04/04/2025 - Borderless Windowed support | ||
Win32Mouse *TheWin32Mouse= NULL; ///< for the WndProc() only | ||
DWORD TheMessageTime = 0; ///< For getting the time that a message was posted from Windows. | ||
|
||
|
@@ -674,7 +675,9 @@ static Bool initializeAppWindows( HINSTANCE hInstance, Int nCmdShow, Bool runWin | |
// Create our main window | ||
windowStyle = WS_POPUP|WS_VISIBLE; | ||
if (runWindowed) | ||
windowStyle |= WS_DLGFRAME | WS_CAPTION | WS_SYSMENU; | ||
// TheSuperHackers @feature @ShizCalev 04/04/2025 - Borderless Windowed support | ||
ShizCalev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if(!ApplicationIsBorderless) | ||
windowStyle |= WS_DLGFRAME | WS_CAPTION | WS_SYSMENU; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No WS_SYSMENU when ApplicationIsBorderless ? Fullscreen has WS_SYSMENU. |
||
else | ||
windowStyle |= WS_EX_TOPMOST | WS_SYSMENU; | ||
|
||
|
@@ -901,6 +904,9 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, | |
//added a preparse step for this flag because it affects window creation style | ||
if (stricmp(token,"-win")==0) | ||
ApplicationIsWindowed=true; | ||
// TheSuperHackers @feature @ShizCalev 04/04/2025 - Borderless Windowed support | ||
ShizCalev marked this conversation as resolved.
Show resolved
Hide resolved
ShizCalev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if(stricmp(token,"-noborder")==0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
ApplicationIsBorderless=true; | ||
token = nextParam(NULL, "\" "); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,6 +78,7 @@ | |
HINSTANCE ApplicationHInstance = NULL; ///< our application instance | ||
HWND ApplicationHWnd = NULL; ///< our application window handle | ||
Bool ApplicationIsWindowed = false; | ||
Bool ApplicationIsBorderless = false; // TheSuperHackers @feature @ShizCalev 04/04/2025 - Borderless Windowed support | ||
Win32Mouse *TheWin32Mouse= NULL; ///< for the WndProc() only | ||
DWORD TheMessageTime = 0; ///< For getting the time that a message was posted from Windows. | ||
|
||
|
@@ -696,7 +697,9 @@ static Bool initializeAppWindows( HINSTANCE hInstance, Int nCmdShow, Bool runWin | |
// Create our main window | ||
windowStyle = WS_POPUP|WS_VISIBLE; | ||
if (runWindowed) | ||
windowStyle |= WS_DLGFRAME | WS_CAPTION | WS_SYSMENU; | ||
// TheSuperHackers @feature @ShizCalev 04/04/2025 - Borderless Windowed support | ||
ShizCalev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if(!ApplicationIsBorderless) | ||
windowStyle |= WS_DLGFRAME | WS_CAPTION | WS_SYSMENU; | ||
else | ||
windowStyle |= WS_EX_TOPMOST | WS_SYSMENU; | ||
|
||
|
@@ -926,6 +929,9 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, | |
//added a preparse step for this flag because it affects window creation style | ||
if (stricmp(token,"-win")==0) | ||
ApplicationIsWindowed=true; | ||
// TheSuperHackers @feature @ShizCalev 04/04/2025 - Borderless Windowed support | ||
ShizCalev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if(stricmp(token,"-noborder")==0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add this in CommandLine.cpp as well, just as a dummy or comment? Reason being that if someone wants to know which options are available, that is the place to look. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a side note: I think it would be neat to implement a logging that prints out all possible arguments when launching it on the command line. In some future change. |
||
ApplicationIsBorderless=true;) | ||
ShizCalev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
token = nextParam(NULL, "\" "); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ShizCalev