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 / Window maximising on multiple monitors

Author
Message
NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 14th Oct 2011 18:20 Edited at: 14th Oct 2011 18:24
Hi, I'm just writing a quick little application to help me with my web design. Something I'd like to complete over the next week!

I'm not really want a completely resizable window, just small standard size and maximised. I've been trying the standard DBPro commands and the additional commands in the Matrix1 plugins with only limited success. The problem is the window's effective resolution/ draw area. It's fine on my main monitor at 1080p, but if I drag the window up onto my 1280x1024 monitor things get all squashed. How would I make it resize the window's resolution better?

This is what I have so far, though this version doesn't work, and it requires Matrix1.



Or this version that doesn't crash, but still only works for my main display



Nick

www.illuminatedfx.com
For web design and custom GUI and 3D model design services.
NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 15th Oct 2011 15:47
I've done some more experimenting, but I still can't workout why the following code comes up with an error message when maximised as it works while resizing.



www.illuminatedfx.com
For web design and custom GUI and 3D model design services.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 15th Oct 2011 17:55 Edited at: 15th Oct 2011 17:57
It's been a while and no one has an answer for all of your questions; neither do I because I don't have dual monitors and haven't really used the additional [Set Display Mode] parameters.

However;

I do know why your view is squashed; this is because the width of your secondary monitors resolution is lower; thus, the window has been improportionately resized (if there is such a word).

This is the same thing that happens when you select 1024x768 as the Windows display mode on a wide screen monitor; or 980x1080 or what ever on a 4:3 ratio monitor; every thing is out of proportion.

As for the error; what does it say?

Perhaps when a window is maximized, its client area may not be returning an acceptable integer value; in the actual plugin's internal code; but this is just a wild guess, but it is the best I can think of; perhaps the return value is infinite; representing the maximum possible value; due to the window being maximized.

[Set Display Mode] parameters; I'm curious about the last parameter; Multimonitor mode; why would this need to be set to zero; if you are dragging the window on a seperate monitor?

NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 15th Oct 2011 18:34 Edited at: 15th Oct 2011 18:48
I understand why it was squashed, I was just wanting to cure it.

The second post's code adapts the res to the window size, but it comes up with an error saying the display doesn't support 32bit when maximised. This is of course wrong, as it allows the display mode to be updated when resizing.

As far as I know the multimonitor parameter simple doubles the horizontal size of the screen res to allow it to cover 2 monitors and 0 disables it. This doesn't apply to my application as I'm using a window and not fullscreen.

I only mentioned multimonitor in my problem at first because I couldn't find a way of finding out the secondary monitor size, but I've cured that my using different commands and only looking at the window size, not display.

www.illuminatedfx.com
For web design and custom GUI and 3D model design services.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 15th Oct 2011 19:26 Edited at: 15th Oct 2011 19:27
Valid points.

I hope it all works out. I happen to have other plugins with similar Client Size functions; Blue Gui, Styx and Enhancements. I am sure there is an API Dll that could be used.

The only thing is when you use Set Display Mode; your objects get deleted and the internal system is reset. Set Display Mode is something that should take place prior to delivering the main content; correct me if I am wrong.

Quote: "Documentation

If this command fails, it will only generate a runtime warning in the CLI. A final EXE produced with this command will not cause your program to fail on machines that do not support the resolution. It is recommended, however, that you check the availability of the display mode before using this command. You can use the CHECK DISPLAY MODE() command to see whether the display mode is supported.

It is vital to know that when this command is called, everything is deleted, including music and sound, so you must re-load all your assets after a call to this command."


NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 15th Oct 2011 20:05 Edited at: 15th Oct 2011 20:06
I'm sure you're right Chris. I seem to remember that being the case from a previous look at this a long time ago. Luckily this is only going to be 2D and almost always using the D3D plugin. It might be slightly less efficient I admit, but theres only a few sprites/ images to load for buttons etc, and this is mainly for my use only anyway, I think my quad core CPU can handle loading a few tiny images The GUI will be stolen from a game I've been developing where I've got my own custom GUI system already

www.illuminatedfx.com
For web design and custom GUI and 3D model design services.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 15th Oct 2011 20:56

Login to post a reply

Server time is: 2026-07-11 14:36:44
Your offset time is: 2026-07-11 14:36:44