Multiple Viewports in Blitzmax?
BlitzMax Forums/BlitzMax Programming/Multiple Viewports in Blitzmax?
| ||
Is it possible to have multiple rendering viewports in Blitzmax? For things like split screen where you don't actually need to change much, just render it to a different, I guess like a set view port sort of command in Blitz3D. Does anyone know whether this is possible in Blitzmax? Ta :) |
| ||
Yep, and the command is SetViewport!!! There's also SetOrigin, which may be of use. |
| ||
Cheers for that I'll take a look! I presume this command isn't new and has been in there from the beginning. :) |
| ||
Ok these commands are more like set Viewport and DrawImage Rect of old skool Blitz. I guess maybe I didn't make myself totally clear. I need a view port that's rendering the full screen into a window. Also to be able to squish it so the aspect ratio is different. A bit like that split screen on Sonic 2 VS Battle where the screen is rendered twice. So I can call the draw commands twice and draw to separate windows but in a different aspect ratio. Like here:- ![]() I hope that makes sense. As if I'm setting up multiple cameras, I know this is possible in Blitz3D, but I don't think it's possible in BlitzMax though. :( |
| ||
Ypu have to think of Blitzmax system (and OpenGL as well) as being "state" driven, otherwise said use setviewport/setorigin twice in your rendering loop. Same apply for setalpha, setcolor, etcetera |
| ||
I would create my own TCamera type which sets the viewport, zoom, map offset, scale, alpha etc. |
| ||
Also to be able to squish it so the aspect ratio is different. A bit like that split screen on Sonic 2 VS Battle where the screen is rendered twice. So I can call the draw commands twice and draw to separate windows but in a different aspect ratio. 1) Set the projection matrix to the aspect and postition of the top screen 2) Render the scene normally 3) Set the projection matrix to the aspect and position of the bottom screen 4) Render the scene normally http://modules.indiepath.com/forum/viewtopic.php?t=19 |
| ||
Cheers guys! More stuff to play with :) |
| ||
I made my own camera type which does what you're asking, but I'm not sharing at this time ;-) It is possible, you just have to set up the projection matrix yourself. Then you have control over the aspect ratio and the zooming/rotation of the display and can have as many cameras as you like. |