hi,

i use dx7 to create a 640x480 pixels window for my game. is it possible that it isn't displayed properly on other monitors (which run another resolution)? someone told me, that there are different ones, like 4:3, 3:2 or something like that, i don't understand this.

another question is: my game runs on 640x480, is it possible to chance resolution to 800x600 later? i mean.. i used fixed sizes for my bitmaps, and to build the whole screen..

thanks for any help,
NOP-erator
Posted on 2003-09-14 14:56:51 by NOP-erator
To make programs work in multiple resolutions an abstraction layer must be created to map the image to the screen. For vectorized graphics a transformation matrix is used (the camera). For raster graphics a choice is made from multiple bitmaps, and/or scaling of the bitmap is done.
Posted on 2003-09-14 15:32:59 by bitRAKE

To make programs work in multiple resolutions an abstraction layer must be created to map the image to the screen.


what is this abstraction layer? never heard of something like this.


For raster graphics a choice is made from multiple bitmaps, and/or scaling of the bitmap is done.


ok, i thought there is an easier way to do that (ok, i know, i'm expecting wonders :p)

what about my first question?

thanks,
NOP
Posted on 2003-09-14 15:49:33 by NOP-erator
An abstraction layer is just a thin adapter.

I am certain there are monitors that will display your game incorrectly, but the best you can hope for is to write to the DX API and then let the user tweek their own monitor. If you find a valid 640x480 display mode and set it, then the rest is up to the OS and monitor.
Posted on 2003-09-14 18:25:44 by bitRAKE
hi,

i found the email about screensize, a friend sent me:


usually monitors have resolutions like:
640*480 (ratio 4 : 3)
VGA 800*600 (ratio 4 : 3)
SVGA 1024*768 (ratio 4 : 3)
and then there is 1600*1200, and even 2048*1536
this resolutions have a ratio of 4 : 3.
and like there are televisions with a ratio of 16/9, there
is a growing number of monitors with resolutions like
1280*1024 (ratio: 5 : 4)
this is the one I have
On Laptops there are 1400*1050, 1900*1280 etc.


should i really care about that? or should i just say, that my game requires a ratio of 4:3 ? :grin: would be much easier...

bye
Posted on 2003-09-15 06:12:54 by NOP-erator
Option #1 - by far the easiest - initialize the screen using the current desktop screen resolution and bit depth.

Option #2 - Learn how to query the hardware for its possible resolutions and let the User decide what they want.

Have a nice day :)
Posted on 2003-09-15 07:24:21 by Homer

Option #1 - by far the easiest - initialize the screen using the current desktop screen resolution and bit depth.

Option #2 - Learn how to query the hardware for its possible resolutions and let the User decide what they want.

Have a nice day :)


thanks, both sounds great.. if there wasn't the problem of my fixed size bitmaps.. i can't (and i don't want) to create bitmaps and do the calculations to build my screen for every possible screen resolutions :eek:

i guess the minority uses a screen ratio of 5:4, right? hehee :o
i could just do a check if it is possible to switch to 640x480, if no, go ahead, buy a new monitor :tongue:

thank you,
bye
Posted on 2003-09-15 08:22:42 by NOP-erator
This might sound like overkill - but please consider using 3D Aided 2D ...
Using D3D you can define a rectangle which has texture coordinates (UV) - you define it so that 0,0 is topleft and 1,1 is bottomright (UV uses floating point) and then ANY TEXTURE applied to that rectangle is AUTOMAGICALLY RESIZED !!!

Have a nicer day than yesterday :)
Posted on 2003-09-15 09:18:02 by Homer
thanks for the hint, but i'm pretty far with the game, no chance to change that now ..

wish you a nice day too :)
Posted on 2003-09-15 15:29:53 by NOP-erator
You mentioned hardcoded bitmaps on a hardcoded resolution...
It may be fastest to change ur code the following way:

Firstly, stick your screen resolution in a couple of variables (maybe call them ScreenWidth and ScreenHeight)

wherever you use hardcoded XY values for the screen, make your code calculate them based on ScreenWidth and ScreenHeight.

Note at this point you havent actually changed resolution, you are writing the "abstraction layer" mentioned above...

Now when you DO change resolution, and alter the Width and Height variables, all your screen XY values will change to suit the new resolution.

Of course this means that your fixed size bitmaps now need to be altered , and the easy way to do that is to resize them in software ;) ie stretch them to their new sizes on demand (whenever the resolution changes).
Posted on 2003-10-13 17:39:45 by Homer
Why not keep a fixed resolution? At 640x480, its OK, most people wouldn't mind if it is a two dimensional game.
Posted on 2003-10-13 21:01:43 by x86asm