Can it hurt if it isn't maximized?

BlitzPlus Forums/BlitzPlus Programming/Can it hurt if it isn't maximized?

Tomas Khan(Posted 2009) [#1]
I was sure there was a topic somewhere in here that said that some computers wouldn't be able to run games at certain screen resolutions. For some reason, though, I don't see it.

Does the problem still arise if you run the game in windowed mode, though? (If you don't maximize the window, will it still crash?)

I remember once running one of my games normally run at 640x480 at, maybe, 1600x480 and watching the enemies warp around in the area outside the borders of the normal window. I also once ran another game at 320x240, I think. But is there any chance that such unusual resolutions will crash if they aren't maximized?

Thank you!
Tomas Khan


Matty(Posted 2009) [#2]
I am fairly confident but am happy to be corrected that if you run a game at windowed mode, as long as the total dimensions is within your desktop's screen resolution it should be fine.

For example you could run a game at:

Graphics 123,456,0,2

and it should be fine.


Sauer(Posted 2009) [#3]
Yeah you'll only get the "Cannot set resolution" error in a full screen mode.


Tomas Khan(Posted 2009) [#4]
Cool! Thank you. That was exactly the thing I was thinking of.


Tomas Khan(Posted 2009) [#5]
I was just thinking... And are there any computers out there with resolutions smaller than 640x480? (I think it said in that other topic that there were a few 640x480s, if only a few.)


plash(Posted 2009) [#6]
Not really any more. Only devices that go below that would be handhelds or maybe even some first-gen netbooks (actually nowa-days the netbooks are usually really weird, wide-screen, resolutions).


Tomas Khan(Posted 2009) [#7]
And what happens if you create a graphics window with a higher resolution in one or more dimensions than the screen? Does it give you an error then, or does part of the window just not show up?


xlsior(Posted 2009) [#8]
And are there any computers out there with resolutions smaller than 640x480?


Some of the older netbooks (low-powered miniature laptops) only do 640 x 400. (Yes, that's 400, not 480)


Sauer(Posted 2009) [#9]
If you don't know what size to make your window, let the computer do it:

HEIGHT=GraphicsHeight()
WIDTH=GraphicsWidth()

Graphics WIDTH,HEIGHT,0,2

While Not KeyHit(1)
	Cls
Wend



This will set up a graphics window the size of their current resolution.

You'll have to make sure your game is compatible with most major resolutions though, as you never know what you'll get from this.


Matty(Posted 2009) [#10]
Sauer - I don't think GraphicsHeight() or GraphicsWidth() return a value *before* the Graphics command is specified.

However as he is using blitzplus this should work fine:

Graphics gadgetwidth(desktop()),gadgetheight(desktop()),0,2

the 0,2 is optional - I thought he wanted it windowed which is why I've included it.


Sauer(Posted 2009) [#11]
Actually putting DESKTOP() in there will return an error of too many parameters. GraphicsHeight() and GraphicsWidth() return the width and height of the current graphics mode.

I see what you're saying, because it doesn't really make sense that it would return a value if no B+ graphics mode is initialized, but for me it always returns the current resolution the user is using.


Gladclef - Ben B(Posted 2009) [#12]
Here's what I always do:

width=graphicswidth(desktopbuffer())
height=graphicsheight(desktopbuffer())
graphics(width,height,0,2)


Tomas Khan(Posted 2009) [#13]
Interesting, but a bit complex for me. In general, I think, I'll stick to 640x480, but for a few things it might be useful to have a different-shaped window. Also, I don't intend to use fullscreen much at all, as it's seemed to me to be a little slow starting up for not too much of an effect.

Now, what happens if the window is wider/longer than the screen? Does it give you an error, or does it start fine but not all visible?