Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Toggling on and off fullscreen

Author
Message
Cuddle Bunniezzz 12
15
Years of Service
User Offline
Joined: 14th Jan 2009
Location: Buffalo, NY
Posted: 29th Aug 2010 05:38
Hey, I created two function that are used to toggle fullscreen mode.

Here it is:
core is the name of the class, it's a bunch of core functions.
_fullscreen is a bool to see if fullscreen is on or not. Used as a failsafe.



It works with turning on and off fullscreen, but there is one little issue that is bugging the hell out of me.

After returning to windowed mode, the sprites I am using look a little blurry. It's a bit hard to see, but normally, my game is in two different colors, black and white, but after returning, I noticed a bit of grey.

I'm not altering the resolution at all, dbScreenWidth() and dbScreenHeight() keep reporting the same numbers.

Got any Ideas?

http://ref.darkgdk.us/ <- Online DarkGDK Refernece. More content coming soon.
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 29th Aug 2010 06:36
The display mode size must match the resolution of the actual application canvas, otherwise you will get some distortion from filtering. Same thing if you run in fullscreen on a non-CRT at a resolution that's lower than that of your monitor.

Cuddle Bunniezzz 12
15
Years of Service
User Offline
Joined: 14th Jan 2009
Location: Buffalo, NY
Posted: 29th Aug 2010 07:26
Okay.

Well, do you have any ideas on how to "fix" it? I've tried dbSetWindowSize() and dbSetDisplayMode(). Both of them end up with the same unwanted result when I restore the window.

http://ref.darkgdk.us/ <- Online DarkGDK Refernece. More content coming soon.
Cuddle Bunniezzz 12
15
Years of Service
User Offline
Joined: 14th Jan 2009
Location: Buffalo, NY
Posted: 30th Aug 2010 01:45
I guess I solved my own problem when I tinkered with the code a bit.



For some reason, if change the second parameter of "dbSetWindowLayout()" to '0', I don't have this issue.

Anyways, I think though I may have found a possible bug:

First off, I was using the resolution of 1024x576 (16:9 ratio), well, when I would toggle fullscreen on then off, I'd get the blurry canvas (if dbSetWindowLayout() 2nd's parameter was '1') when I was back in windowed mode.

Well, I used the dbScreenWidth() and dbScreenHeight() functions to tell me what the resolution was 1024x576. Both in fullscreen and windowed mode.

Well, this looks a little suspicious since the windowed mode is now blurry. I did a screen cap of before I turned on fullscreen, the canvas was 1024x576, then I took another after I toggled fullscreen on then off, the screen cap showed I had a resolution of 1022x574. Oddly enough, dbScreenWidth() and dbScreenHeight() reported 1024x576.

Something seems off here.

Well, in the code if I tried to use dbSetDisplayMode() or dbSetWindowSize() (after toggling on then off fullscreen mode), and punched in '1024' and '576', I would still have the blurry canvas (and the actual resolution would be 1022x574).

So I think that if the second parameter in dbSetWindowLayout() gets set to '1' can mess up some things.

So should I report this bug?

http://ref.darkgdk.us/ <- Online DarkGDK Refernece. More content coming soon.

Login to post a reply

Server time is: 2024-11-19 18:24:03
Your offset time is: 2024-11-19 18:24:03