Can you create a viewport?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
General Kip

Can you create a viewport?

Post by General Kip »

Hi

I need to something like

setviewX=100;
setviewY=0;
setClipX=200;
setClipY=300;

This will then be used by all drawing, in the excample above, all drawing will be "moved" 100 pixels X. This I know how to do, its easy but:

The last 2 variables states that if drawing is done past th point of (200,300) on screen it shall be ignored. This can make drawing only half om images near the "border"

I know this is a simple form of viewport that ignores camera etc, but for now its all I need.

Thanks
Pharoseer
Posts: 5
Joined: Wed Sep 03, 2003 6:41 am

Post by Pharoseer »

Hi General Kip,

Check out the Splitscreen tutorial by Max Winkel: Click Here
He shows how to use 4 different cameras at once, with each drawing to different parts of the screen.

If that doesn't help I can post a small code sample as I'm working on a tutorial of my own that utilizes the ideas put forth in Max's tutorial.

-Pharoseer
General Kip

Post by General Kip »

yes i read that articl also. The thinh is i hav so many things to code and I try to do a bit at a time.

What im looking for is simply adding a global clipping to the drawing of stuff, maybe gui and 2d is enough for now. Is there any simple way of doing that?
Gneral Kip

Post by Gneral Kip »

Hey, in that article, when reading it a second time, I found

driver->setViewPort(rect<s32>(0,0,ResX,ResY));

This can be used for exactly what I need to do. It dos screw up my mouscontrol though, but I guess that will b controllabl when i switch to fully irrlicht-gui
Pharoseer
Posts: 5
Joined: Wed Sep 03, 2003 6:41 am

Post by Pharoseer »

How is it screwing up your mouse control? I might be able to help figure it out if you post a bit of your code and explain the problem in detail.

-Pharoseer
Guest

Post by Guest »

well that setviewport does some things i dont understand... For example it compresses the 2dimage when I set the two last parameters to something... Which is odd.

I need the two first parameters to set where the "screen starts" so I can move chunks of the gui for example to a certain part of the screen. This seemes to work as it should. The last two should define the size of the "drawing window" and all pics, text etc that are called to be drawn outside this "drawing window" should be clipped. This does not work...
Guest

Post by Guest »

No i was wrong it doesnt help. It might work for 3d though...
Post Reply