Resolution and window size ...

BlitzMax Forums/BlitzMax Programming/Resolution and window size ...

mic_pringle(Posted 2009) [#1]
Hi,

I would like to have a window with a size of 1024 x 768 but with a resolution of 320 x 200 or 640 x 480. Is this possible ?

From what I understand BB sets up the orthographic view so that the resolution matches your window size, but is there a way to override this ?

Perhaps using a projection matrix or something like that ?

Any help would be greatly appreciated.

Thanks

-Mic


Tommo(Posted 2009) [#2]
For openGL you can simply call glOrtho to modify projection.
eg:
glMatrixMode GL_PROJECTION
glLoadIdentity	
glOrtho 0, 320, 200, 0, -1, 1
...(render)
Flip



mic_pringle(Posted 2009) [#3]
@Tommo

But won't this change this size of the window ?

What I don't understand is how to change the resolution and the size of the window independently ?

Thanks

-Mic


ImaginaryHuman(Posted 2009) [#4]
glOrtho changes how much of the world the camera can see. So it's like saying the camera can only look at a portion of the world 320x200 pixels. .... the *viewport* defines how much of your WINDOW the camera's `eye` takes up... so 320x200 wills stretch to the full size of your window, unless you made a smaller viewport.

So the projection is how much of the world the camera can see, and once it has been limited to that confined view, the viewport then says how detailed the view is - it like the relationship between two resolutions - 320x200 in the world gets mapped to 800x600.


mic_pringle(Posted 2009) [#5]
Would it be possible for you to provide an example then of how i can create a window of 800 x 600 with a resolution on 320 x 200 that fills the window? It would be greatly appreciated?


plash(Posted 2009) [#6]
Would it be possible for you to provide an example then of how i can create a window of 800 x 600 with a resolution on 320 x 200 that fills the window?
I think that is precisely what Indiepath's ProjMatrix module does.. But I don't think it's easy to get (I could be wrong, his RTT code was a big hassle to get a hold of in the past).


ImaginaryHuman(Posted 2009) [#7]
Open an 800x600 and window and then call tommo's code above :-D