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.

DarkBASIC Professional Discussion / Set Display Mode - Windowed Mode

Author
Message
Grasmann
17
Years of Service
User Offline
Joined: 1st Sep 2008
Location:
Posted: 31st Jan 2012 14:42 Edited at: 31st Jan 2012 15:43
I got one question regarding the command "Set Display Mode".

I'm currently working on an Entity-Viewer for my game engine.
I'm heavily working with bbb GUI and whenever I resize the Window I use "Set Display Mode" to update the window to it´s new resolution.

This doesn't generate any problems with resolutions like 687x751 for example.
But if I want to maximize the window, which results in a resolution of 1920x1024, the program crashes.
If I try to set this resolution right at the start the program gives me "Runtime Error 1507 - Display using 32 bit is not supported by available hardware"

wtf?
What's the difference between 687x751 and 1920x1024?

EDIT:
Btw the program is set to compile with window mode.
EDIT:
Of course there's no difference if I try it with 16 bit Depth.


EDIT:
I just discovered that it works with a resolution of 1919x1024.
It also crashes with a resolution of 1919x1080.
The resolution 1919x1079 on the other hand is fine.
My Monitors maximum resolution is 1920x1080, so I always have to subtract 1.

It seems like resolutions of the monitors max resolution are crashing in windowed mode.
Seems like a bug to me.
In my understanding the maximum resolution of the monitor should be fine in windowed mode.

Maybe it's a Windows 7/Vista bug. I don't really remember if Windows XP still had a window border for maximized windows, but Windows 7 has not, but maybe that has nothing to do with it anyway.

EDIT:
This is my fix, but I still think it's a strange behavior.

Since "Check Display Mode" can't be used in this windowed mode situation this is my only chance, I guess. I just have to hope it will always work as intended XD.
There is no additional check for windowed mode because the program will always be in windowed mode.
Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 1st Feb 2012 03:24 Edited at: 1st Feb 2012 03:54
Heya champ;

I've been looking into this issue lately too. Start doing searches on User32.DLL, there's some really cool sample code about that solves some of these problems.

Let me looky... I'll post a link in a second.

Here is the thread;

http://forum.thegamecreators.com/?m=forum_view&t=25974&b=1

Let me know if you need further help.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Grasmann
17
Years of Service
User Offline
Joined: 1st Sep 2008
Location:
Posted: 1st Feb 2012 08:46 Edited at: 1st Feb 2012 08:47
Thanks for the link.
The resizing is already working as intended.
I know about the reloading of media, and built my entity system to do this for me automatically.

The way I did this I can even minimize without crashing the application.

The only question I have is actually the same which is unanswered in the thread you linked here: Why does the maximum desktop resolution crash the windowed mode? XD

Login to post a reply

Server time is: 2026-07-10 09:56:21
Your offset time is: 2026-07-10 09:56:21