BUG: incorrect window size in fullscreen

My monitor is 1440x900 and I’m running Windows 10. I have the following in my render script’s update function:

print(render.get_width().."x"..render.get_height())
print(render.get_window_width().."x"..render.get_window_height())

In my game.project file I have the width and height set to 840x494. With fullscreen unticked, as I resize the window I get correct sizes in the log. With the taskbar hidden and the window maximized I get:

DEBUG:SCRIPT: 840x494
DEBUG:SCRIPT: 1440x877

This is correct since the title bar is 23 pixels tall. However with the fullscreen setting in game.project ticked I get:

DEBUG:SCRIPT: 840x494
DEBUG:SCRIPT: 800x600

Even though I should be getting 1440x900, it’s drawing at 800x600 then stretching it to 1440x900 and making it distorted and blurry. Trying some other values for the width and height in game.project produce different results:

DEBUG:SCRIPT: 1840x494
DEBUG:SCRIPT: 1366x768

DEBUG:SCRIPT: 840x1494
DEBUG:SCRIPT: 1280x1024

The renderer seems to be forced to one of a possible set of resolutions, which is not at all expected and doesn’t match the behaviour when fullscreen isn’t ticked. In windowed mode render.get_window_width() and render.get_window_height() return the client size of the window, which in fullscreen I would expect to be 1440x900.

Have you tried to use DefOS to toggle fullscreen?

1 Like

isn’t this an issue with defold? fullscreen is rendering incorrectly, stretching the image instead of natively using the monitor resolution. this issue is still happening. an extension just to get a functioning fullscreen doesn’t make sense.

I think we need more information to consider it an issue or not, we haven’t had any bug reports regarding it for a long time. Do you have a repro case perhaps?

1 Like

it could be my render script and not related to the original post. let’s find out:

for each window resize callback, the render target is changed to fill the window as much as pixel perfect possible. does fullscreen in game project settings trigger this callback? if not, this would cause this issue since the render target is not being resized when the window is fullscreen’d.

i need the functionality to toggle fullscreen, and if this is not possible with default defold scripting, i will try defOS.

i would very much like to ask this to be considered as a feature request, it makes defold feel like it is not a desktop-capable engine, which makes me sad. :frowning:

1 Like

Well, this could still be an issue with your render script or overall set up. If you can provide a repro case can take a look!