View Full Version : Full-screen Borderless Window vs. Windowed-mode Border Window
DopeTrail
09-02-2004, 07:26 AM
Hi,
I wanted to know how folks go from windowed mode to full screen mode in their games. Specifically....we have a border around the game window in "Windowed Mode". However, when we go to Full Screen mode -- the border still says; we want to be borderless in full-screen mode.
We are using Visual Basic and for some reason we can't set the form's borderstyle to be borderless during run-time.
How do C++ coders do this? I know that one can do a "CreateWindow" to handle the border issue when creating the window. Is there a message to change the window style during run-time?
The other option I was thinking is to move the window up on the screen so that the border is not evident.
Look forward to some insights,
Dope Trail
DopeTrail
09-02-2004, 07:29 AM
Thirty seconds after posting...I realized something...
There is one other option....
I can have 2 windows. If the player goes into windowed-mode, I can set up the border window. If the player goes into full-screen mode, I can use the borderless window.
Let me know if there's a better option,
Dope Trail
DopeTrail
09-02-2004, 08:01 AM
Issue Solved!
We used ModifyStyle and ModifyStyleEx to update the window style during run-time.
More info here...
http://hjem.get2net.dk/GeWare/VBTips1.htm
Search for ModifyStyle on the page.
-- Dope Trail
Mark Sheeky
09-02-2004, 11:53 AM
Not so much a question as a masterclass :) Well done!
Mark
Cornutopia Games
http://www.cornutopia.net
I use Delphi for my games. In Delphi you can change a decent number of window attributes at runtime with the various window properties. I did note however, that setting the window to borderless changed the window handle. Looking at the delphi source, I found that for the borderless change they output the window state to a stream, closed the window and created a new window from the stream only with a different property for the border.
My response was to decide that there must have been a good reason to do things that way, but I wanted to maintain the window handle from the start. (various things would require re-initializing otherwise)
My solution was when going Fullscreen to set the window to no titlebar gadgets and non resizable border. This made a window the size of the screen and no clickable areas. While Fullscreen I was using DirectDraw to write to the screen anyway so I just overwrite the window with border.
Your solution seems much simpler, but If you do find a pitfall you could go with this option.
Nemesis
09-02-2004, 04:20 PM
I am planning to have windowed / fullscreen and resolution options take effect after exiting and reloading the game. That is, changing screen options simply writes the changes to the options file or registry that are read on re-launching the game. I think it makes life easier and it is still quite a reasonable approach.
gmcbay
09-02-2004, 05:29 PM
My engine uses SetWindowLong in Win32/C++ which is also what the VB/ModifyStyle code uses. Snipped from my SetDisplayMode function:
if(!fullscreen)
{
windowStyle = WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX ;
}
else
{
windowStyle = WS_POPUP;
}
SetWindowLong(hwnd, GWL_STYLE, windowStyle);
Personally I get annoyed at games that don't allow me to switch resolutions and/or to and from fullscreen without restarting. You can probably get away with it, because I'm probably not your "average customer", but I find it annoying. Not quite as bad as games that disable alt-tab, etc but pretty close.
SuperBug
09-02-2004, 11:50 PM
You should use SetWindowLongPtr instead of the deprecated SetWindowLong to make your code portable to the 64-bit platform (just a reminder, in case you care ;) ...).
Nemesis
09-03-2004, 12:16 AM
Personally I get annoyed at games that don't allow me to switch resolutions and/or to and from fullscreen without restarting. You can probably get away with it, because I'm probably not your "average customer", but I find it annoying. Not quite as bad as games that disable alt-tab, etc but pretty close.
I think that actually there is a significant portion of gamers that do not like changes taking effect only after restarting. However, from a technical point of view it does make life easier especially when doing things like changing the texture quality that require reloading more detailed or less detailed textures. I'll very probably risk it.. and anyway.. it's not like gamers are going to change widnow mode, resolution, texture quality etc. every other minute or so.. it's usually a one off configuration. In fact it sometimes makes sense to have a popup window with such options prior to startup.
Now that I think of it.. we had a similar thread running on the Dex fora.. it's probably in the archives.
vBulletin v3.6.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.