Asset - Extension Borderless Windows DLL for Gamemaker Studio 1 & 2

A

AtlaStar

Guest
Hi everyone,

Just published a new asset on the marketplace that enables borderless window mode for both GM:S 1 and 2 Windows targets.

Getting it to work in GM:S 1.4.1772 was challenging to say the least, but I got it done and decided to ensure it was cross compatible. Saw the other GM:S 2 specific asset and found the lack of re-sizing and other caveats to make it work discouraging, so I decided to add those features to a standard borderless fullscreen DLL I wrote for a friend.

Features:
Can resize the window, either via a function, border while in bordered mode, or drag-able icon in borderless.

Can customize the drag icon used and is as simple as assigning a sprite in GM:S.

Stores the previous window state so restoring the window dimensions and border state is accomplished with a single function.

Planned features:
Ability to drag to move the window while in borderless mode. Code already exists to accomplish this, but not sure how best to start the movement.

Possible features:
The ability to create custom window skins

Price: $9.99

Justification for price:
Getting this to work in GM:S 1 required so many workarounds and some serious bypassing of YYG's implementation of their Window Procedure, making the amount of time invested and challenges involved in making this work on both platforms justify the price in my opinion.

YoYo Marketplace Asset Listing:
https://marketplace.yoyogames.com/assets/6009/borderless-windows

If the link isn't visible due to low post count, the asset name is Borderless Windows on the marketplace.
 
Last edited by a moderator:
S

Sam (Deleted User)

Guest
I noticed you included the *.a and *.def files with the extension. Just thought I'd give you the heads up, doing that is pretty redundant.
 
A

AtlaStar

Guest
I noticed you included the *.a and *.def files with the extension. Just thought I'd give you the heads up, doing that is pretty redundant.
Yeah, got lazy and ended up pointing the entire build to the extensions folder for faster testing so they ended up staying when I compiled and linked everything.
 
S

Sam (Deleted User)

Guest
Oh, I gotcha.

I gotta hand it to ya, this must've been a lot of work. I've tried writing an extension for Windows that did this in the past but I eventually took it down because update after update of GMStudio kept on breaking all my work.
 
A

AtlaStar

Guest
It was a task to say the least...still not sure if the price might be a bit to high though, but getting it to work just on GM:S 1 was a major pain...and getting the windows to be able to be sized when in bordered mode without breaking things was a challenge. Basically the whole thing required through a ton of trial and error rewriting a good amount of their window procedure since the calculated rectangles for the client area and non-client area would go into a little panic if the non-client area wan't sized or positioned where YYG thought it should be...most of the work really was figuring out where YYG has to be explicitly calling SetWindowPos or a similar function when what I said previously was the case, and basically writing stuff for those messages to handle them without forwarding them to their window procedure and having them passed to their complicit window message handlers.
 
S

Sam (Deleted User)

Guest
Well, I'm impressed. :) Depending on how it sells you might want to consider a slightly lower price. But I'd keep it where it's at first and give yourself a chance to see how it does.

Best of luck!
 
Z

zendraw

Guest
whats the difference betwean this, and just setting it up in the global settings?...
 
S

Sam (Deleted User)

Guest
whats the difference betwean this, and just setting it up in the global settings?...
You can switch in and out of borderless mode using code, and you can resize the window even when borderless is turned on.

Global game settings / options can't do that.
 
A

AtlaStar

Guest
whats the difference betwean this, and just setting it up in the global settings?...
In the global settings, you only get to set borderless fullscreen. You have no ability to resize the window, nor can you go back to a bordered window at runtime. So basically you are restricting what your end users can use to play the game, as some might not prefer to play in borderless fullscreen, while other's might prefer it. It's all about giving options to the end user, and allowing them to toggle the window state to the version they prefer. The asset definitely isn't for everyone, but it is for those who are at the final stages of development and want to give their players more freedom when it comes to this sort of thing.
 
Z

zendraw

Guest
what do you mean by borderless fullscreen? you mean just fullscreen?
the only thing i see that you cant do with gm functions is switchin betwean borderless/border. otherwise the inbuild functions cover the rest...
 
A

AtlaStar

Guest
what do you mean by borderless fullscreen? you mean just fullscreen?
the only thing i see that you cant do with gm functions is switchin betwean borderless/border. otherwise the inbuild functions cover the rest...
Nope, regular fullscreen is actually different than borderless fullscreen. Regular fullscreen changes the behavior of certain windows functions.The biggest example being when in true fullscreen, if you try to alt tab it won't bring up the window showing your list of open applications, but rather you end up minimizing the application window entirely which is actually costly on system resources and tends to cause delay.

Borderless fullscreen on the otherhand is sizing the window so that it isn't truly in fullscreen mode, which means that it doesn't modify how things like alt tabbing work and it doesn't have a costly operation involved when changing to a different window. But YYG's implementation actually sets the fullscreen flag as well, meaning that you still incur the cost of switching the state of the window and it still minimizes it on pressing alt tab.

Finally, due to the method required to allow you to toggle between borderless and bordered window mode, the built in functions won't work. Those functions rely on knowing whether the window is bordered or not, and uses a variable stored in the runner which us end users have no access to. If that variable isn't set it tries to move and resize the window as if it were in the expected mode rather than what mode it is in.

So not counting needing to rewrite the built in functions to work with toggling, another difference is that if you press alt tab while in my borderless fullscreen settings, the alt tab overlay appears over your game window rather than forcing a minimize/maximize making it easier to switch back and forth between the game and some other application. Also hear that it changes the behavior when using dual screens, since if I recall if in true fullscreen clicking on a second screen minimizes the window as well (I don't use a second screen so I could be mistaken but I recall hearing this complaint somewhere before), making the DLL work better for people like streamers who control their stream settings via stuff on the second screen.

As I said, the asset isn't for everyone, and on the surface doesn't look as useful as it really is.
 
Z

zendraw

Guest
i didnt say how useful it is, i sayd except this bordered/borderless windowed mode, everything else is easily done with gm functions.
 
S

Sam (Deleted User)

Guest
i didnt say how useful it is, i sayd except this bordered/borderless windowed mode, everything else is easily done with gm functions.
This is actually not so. I know from writing my own extensions that you can't move or resize a borderless window using window_set_rectangle/size/pos, because of a glitch where the screen doesn't repaint like it should, I assume this is because YYG forgot to set the last argument of MoveWindow to true for repainting. So anyway, you'll need an extension to move or resize borderless windows.
 
Z

zendraw

Guest
it doesnt repaint like it shuld? can you show this 'glitch'? ive never encountered it. have you sent like a ticket to yoyo to fix it?
 
S

Sam (Deleted User)

Guest
1) Set the window to borderless in Game Settings
2) Create an object in an empty room with this code in Gobal Left Mouse Down:
Code:
window_set_rectangle(display_mouse_get_x()-mx,display_mouse_get_y()-my,
window_get_width(),window_get_height());
And this in Global Left Mouse Pressed (make a duplicate of this event as the Create event):
Code:
mx = display_mouse_get_x()-window_get_x();
my = display_mouse_get_y()-window_get_y();
Then, run the game, and try to drag the window with the mouse. you will end up with something like this:

glitch.png

Edit:

Thanks for the idea, bug report submitted. :) (Happens both in GMS 1.4 and 2)
 
Last edited by a moderator:
Z

zendraw

Guest
i didnt u se set rectangle, cus it seemd the wrong function for the job, but i did use set position, which, duh, says what it does and i have no problems, altho the calculations are not exactly those, it works fine in both borderless and with border.
Code:
if (window_get_fullscreen()==false)
{
    if (mouse_check_button(mb_left))
    {
        window_set_position(wx+display_mouse_get_x()-twx, wy+display_mouse_get_y()-twy);
    } else
    {
        wx=window_get_x();
        wy=window_get_x();
        twx=display_mouse_get_x();
        twy=display_mouse_get_y();
    }
}
 
S

Sam (Deleted User)

Guest
it does the same thing with window_set_position()....

(I thought I made that abundantly clear)

But the fact of the matter is, it shouldn't be doing it with any of these functions.

It does it with all of them.
 
Last edited by a moderator:
S

Sam (Deleted User)

Guest
All I know is I wrote a wrapper function for MoveWindow with the repaint argument set to true, and it no longer does that. (Setting repaint to false makes it behave just like GMS's default functions). Thanks for letting me know you aren't experiencing this issue. I'm not sure what to make of it though, it's really strange my computer is doing that...

P.S. I have tried it on multiple computers in my house and the problem happens on all of them.
 
Z

zendraw

Guest
best thing in my opinion is to contact yoyo support and explain your situation or make a topic about it. or check what changes youve done with your windows, etc.
 
S

Sam (Deleted User)

Guest
Yeah, I created a helpdesk ticket for this. Thanks for the idea. :)
 
A

AtlaStar

Guest
Yeah, I created a helpdesk ticket for this. Thanks for the idea. :)
Actually, check your version. It is possible that YYG fixed that behavior in one of the patches as I started dev on this back in 1.4.16xx. I didn't see any mention of it though in the patch notes. So it could be that they fixed things in the latest version, but then again if that is the case, how long until it breaks again...I mean 1772 did break the window_handle() function again on windows targets, and your standard SetWindowLong(hwnd, GWL_STYLE, ...) method on windows under this version still causes the infinite resizing glitch.

That said though, it does appear that moving/resizing the window without the DLL on the latest version appears to work correctly, at least on my system.

It is also possible that the rendering issue is graphics card based and something to do with YYG's code being incompatible with peoples drivers. Making the concern being that if someone were to download a game made under this version that some end users would experience the same issue you are having.

Finally though, the one thing that this does provide is an immediate fix for is the random fullscreen black screen bug on Win 10 that some users report, along with avoiding the possibly issues mentioned above.
 
S

Sam (Deleted User)

Guest
Since 1772 broke window_handle() on Windows, do you happen to know whether you or someone else has reported it? I don't have access to Mantis.
 

Elevory

Member
Hi, love the extension! Been using it for about a year now.

However, I think it may lack compatibility with the GM 2.3 runtime - entering Borderless Windowed mode now causes my app to render behind the Windows taskbar. In the past, it would take focus and draw on top of the Windows UI.

I realize this extension is a few years old now, so I understand if it's no longer supported, but if you have any ideas on how to fix this issue I would be grateful!

Thank you.

EDIT: I figured out what happened, there's nothing wrong with the extension! :)

When I converted my project to GM 2.3, it altered my room order - the room containing ALTA_boot_obj was never loaded.

I'll leave this comment up in case anyone else runs into a similar issue.
 
Last edited:
Top