Sorry I forgot about this:
And I have another question, how did you do (like I see in the screenshots) that if you make another camera you can have a rect on screen where you see what that new camera is pointing at
Well that "rect" that you cand see on screen is called Viewport.
In example2 you can see this pieces of code:
Code: Select all
GameManager* mGameManager;
scene::SceneManager* mSMng;
render::RenderWindow* mWin;
render::RenderManager* mRMng;
scene::Camera* cam1;
scene::Camera* cam2;
the variables to use.
Code: Select all
mGameManager = new GameManager();
mGameManager->initialise();
mSMng = mGameManager->getSceneManager();
mRMng = mGameManager->getRenderManager();
cam1 = mSMng->createCamera();
cam2 = mSMng->createCamera();
mWin = mRMng->getMainWindow();
initialize the game and the variables.
Code: Select all
render::Viewport* vp1=mWin->addViewport(cam1,0);
vp1->setBackgroundColour(render::Colour(0.1f,0.1f,0.1f));
render::Viewport* vp2=mWin->addViewport(cam2,1,0.65f,0.65f,0.3f,0.3f);
vp2->setBackgroundColour(render::Colour(0.1f,0.1f,0.9f));
add 2 viewports to the render window with a camera atached to wich one of them and giving th proprieties of them.
First has cam1 is on the entire dimention of the render window and the rendering order(zorder) 0.
Second has cam1, has the relative position 0.65f,0.65f (0.65% top of the render window, 0.65% left of the render), the relative dimention of 0.3f,0.3f and the render order of 1.
So the first Viewport renders the scene first on the GDI(graphic device interface) coresponding to the attached camera's view.
, the second renders the scene second.
Code: Select all
cam1->setPosition(0, 10, 0);
cam2->setPosition(0, 10, -15);
cam2->rotateX(10.0f);
Move the cameras were ever you want, it will update your view.
Even so as the engine is made you should remove one of the viewports anytime in your game play and just disapear, letting the atached camera availabe to reuse. BUT that needs to be tested to see of any bugs and fix them (as only me is writting this engine yet, I can't verify everithing I plan to implement in it).
Thank you very much for the interest you show in my work, and the apreciation on my "white nights" I spent on it so fare.
To let you know of my recent work I have just made I simple mesh file format and a simple importer for it that works. Update from the SVN.
Did you took the sources form the SVN?
Regards.