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 / Custom window size static resolution

Author
Message
Naphier
15
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 12th Dec 2011 03:49
Hi everyone.
I'd like to have a window with the screen resolution of say, 1600x900, but the actual window size to be 600x900.
I want this to happen WITHOUT scaling the window's contents.

I thought IanM's MatrixUtils had a client window size command that would do it, but it causes the window contents to scale just the same.

Help please, I want my game to have this aspect ratio, but I don't want to have to fill the sides of the screen with logos or something...

Thanks!

MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 12th Dec 2011 20:03
Easy...

Screen type... full desktop

set display mode 600,900,32

Does this not do it for you?

I tested it and works fine...

Naphier
15
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 12th Dec 2011 20:09
Thanks for the try, but I'm trying to do this in a window and full desktop takes up the full desktop...
Secondly, this just stretches the 600x900 resolution to the desktop.

I want no stretching in a window that is size 600x900.

Did you try your test with something drawn in it? I drew a box that is supposed to be 100x100 and it was stretched to like 200x100...

MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 12th Dec 2011 23:01 Edited at: 12th Dec 2011 23:03
Well 600x900 isnt exactly square...

I created a.cube 20 and enabled arrowkey movement...

Oh... res at 1600... Hmm that should be easy... set the window res to 1600... And set the window height width to the other...

EDIT

you will still get stretching at that aspect...

But maybe some one knows a trick... you could maybe try something tricky with 4:3 in a 16:10 screen... forgot how it goes...

Naphier
15
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 12th Dec 2011 23:10
The stretching is the issue.

I want a 600x900 window with no stretching.

If you use any window size that is not the same aspect as the program's resolution then you get stretching.

PS - 600x900 isn't square, but a box,0,0,100,100 should be

MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 12th Dec 2011 23:15
Hmm... as I can not use dbpro at present I am stumped for the time being... I dont think my test was stretched earlier... shame I did not save the code...

But it was rather basic... but I did not test in a window as I thought you wanted a full screen behe...

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 13th Dec 2011 00:12
600x900 isn't a resolution supported by any graphics card, therefore it is not possible to have exactly that resolution. However, it is an aspect ratio of 4:3, which means you should pick a resolution slightly higher than 600x900 (for example 1024x768) and then set the window size to 600x900:



TheComet

Naphier
15
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 13th Dec 2011 02:34
Thanks, but again, not what I'm looking for.
600x900 is a 2:3 aspect ratio...

I simply want a window sized in a 2:3 aspect ratio (think portrait).
I don't want stretching/scaling.

I understand how to use set display mode and set window size.
These commands do not accomplish what I am looking for.

Again I'm looking for a way to create a windowed program that would have a default size of 600 pixels wide by 900 pixels high with no stretching/scaling.

Thanks!

Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 13th Dec 2011 04:18 Edited at: 13th Dec 2011 04:33
It's an odd size, I don't know that you are really going to be able to set it up the way you want specifically. does the window itself absolutely have to be those dimensions? couldn't you choose a more common window size and just stick a black border fixed to the camera to frame out a 600x900 section like matting a picture?

edit
actually i just tried this, and don't seem to see any stretching:



image result attached


Naphier
15
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 13th Dec 2011 15:53 Edited at: 13th Dec 2011 15:59
I'll be damned!
You don't even need sync.
I thought set display mode wouldn't work with unavailable resolutions so I'd been trying everything with set window size.
WTF....

Awesome I just tested this out for quite a variety of window sizes and it works fine until the window is under 100px high, but if I ever want to do that it will be a rarity.

I think Mr. V had this result before too, but completely overlooked it because he was using fullscreen.
UGH
Sorry Mr. V for not being more perceptive!

Thanks to both of you you've saved me from having to have letterbox crap on the sides of my program.
I knew there was a simple way, so simple it was easy to overlook!!!

Thanks!!!

EDIT
I also figured out why I seemingly got some stretching at low window sizes of 100x100... it's because DBpro is making the window size x by y and including the title bar in that sizE! Title bar goes away and a 100x100 window is perfectly square. So exciting!

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 13th Dec 2011 17:12 Edited at: 13th Dec 2011 18:20
Well butter mah biscuit... I didn't know you could set the display mode to unavailable settings.

TheComet

Naphier
15
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 2nd Jan 2012 23:41
Alright, well... apparently this doesn't work on all machines.
I just tried it out on my laptop and it won't set the display mode to an unavailable display mode...
It worked fine on two desktop computers.
So... back to the drawing board.

I'll probably use Ortu's idea of fixing the camera view.

Naphier
15
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 6th Jan 2012 01:26
Keeping this alive because I'm just troubled that I can't make custom sized windows for programs...
So anyway I ran some more testing on my laptop and found out that I can make "unsupported" resolution sizes as long as the height is under 900 (900 is the max resolution height anyway ... 1600x900).
Seems like odd behavior and it's not consistent on other machines, so I'm assuming it has something to do with hardware.

Now I have to ask if anyone knows why this hardware issue exists?
I'd hate to create a game like this with a custom sized window and someone buys it and can't run it.
I guess I can always make the program default to fullscreen highest resolution possible and have letterboxing on the sides.

Thoughts, opinions?
I'm sort of surprised no one else has tried to make custom sized windowed programs with DBPro. I see some stuff in DBC, but not really custom sized windows.
What does everyone do for resizeable windows?

I'm a curious

basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 6th Jan 2012 02:31 Edited at: 6th Jan 2012 02:31
I don't think there is a direct solution to this problem. my current project has an option where you can have full screen mode while the image is at 640,480. the solution is simple:

1- set the screen mode to the desired one, exp: 800,600 .
2- create bitmap with a resolution exp: 640,480 (let's say bitmap_1).
3- do
copy bitmap_1 to bitmap_0
loop
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 6th Jan 2012 02:32
I use STYX for window shaping works a charm and I think I solved my app crash on screen lock issue... my app should be ready for demoing by the weekend possibly saturday night...

Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 6th Jan 2012 05:10 Edited at: 6th Jan 2012 05:13
Hi Naphier,

Things get even more complicated when you notice slight artefacts in the game screen too, such as the skipped lines that I experienced in this thread;

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

Having a window resolution at one size near the max resolution introduced artefacts, which is ridiculous!

I really gotta sit down again and figure out what's what when it comes to these basic concepts such as Window size.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Naphier
15
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 6th Jan 2012 15:32
Thanks for the info, BFM. I'm not experiencing that with this program, but I have with others (see the post in your thread). Hope we can get some explicit answers for edumacational purposes.

MrV... what is this Styx??? Looks handy. That will likely be my next purchase from TGC... even has a splash screen builder with progress bar? What ? What?

I'll keep my eyes peeld for you app this weekend. GL finishing it soon!

MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 6th Jan 2012 21:56
Im nearly done with a demo used many features of STYX and just looking into mouse interaction to free up the entire keyboard for user input...

I have a WIP in the erm WIP board haha sorry on phone right now are my nets playing up on me...

But yeah theres a lot of useful things included with STYX which are useful for me in pretty much any type of project...

Well worth the money in my opinion... and umm theres a lot of ready to go examples that come with it !!!

In other words ready to go copy and paste code ^^ which you can alter to your requirements

Just ask me if you need to know anything about it or any pf the other plugins I have a fair few of them still got a handful to buy yet but I really want to buy Genetica soon!

Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 10th Jan 2012 04:25
Hi Mr Valentine,

Regarding Styx, I've seen other users complaining that in conflicts with other DarkBASIC Pro plugins, such as IanM's Matrix Utilities. Can you confirm if this problem has been fixed, as there's no point in myself downloading another plugin if it's going to break the ones I already use.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 10th Jan 2012 04:40
I do not use IanM's... so can not say... I am still getting used to all the plugins I bought hehe

there should be workarounds

IanMs is not official but it is urm widely used... Someone correct that bit not in mood to fully explain right now...

Login to post a reply

Server time is: 2026-07-09 20:55:00
Your offset time is: 2026-07-09 20:55:00