Is nxOgre the reason I cant get to the next level

mnm23

24-08-2006 06:35:43

Hey guys. Back with another problem. Im not 100% sure if it is a problem with nxOgre, but i have tried this in ogre alone and it worked fine. Ok so what i am trying to do is switch from one level to the next. When i try to switch, my game crashes. My levels are in seperate .cpp files from each other.

Error # 9999
Function: Render Target::addViewport
Description: Can't create another viewport for MyOgreWindow with Z-Order 0 because a viewport exists with this Z-Oder already.


So then i write a line to destroy the viewport. And the game crashes again at this line. In the new level it is changing to not current level that it is in.

mViewport->setBackgroundColour(ColourValue(0.0, 0.0, 1.0));


Then i try to create a single viewport in a .cpp file so all the levels can just call from it instead of creating a new one in each level, but that didnt work either. This is very wierd because i didnt have this trouble when i did this in ogre (with out any addons). Thanks again guys.

betajaen

24-08-2006 10:04:42

Sounds like an Ogre issue to me.

Have you tried deleting the Camera before deleting the viewport?

mnm23

24-08-2006 13:34:02

Yes i did try that. It still crashed the game and pointed to the last line of code i wrote in the previous post. I will post this in Ogre and see if they can come up with anything.

mnm23

24-08-2006 13:54:05

Here is the link to the post i made in the Ogre forum.

http://www.ogre3d.org/phpBB2/viewtopic. ... 833#170833

mnm23

24-08-2006 14:59:47

Ok this problem is definately related to nxOgre. I just put the same code into an older project that was using ogre and ogreNewt and it went to the other levels fine, but in ogre and nxOgre it crashes when trying to switch.

betajaen

24-08-2006 15:08:10

I can't see how; NxOgre doesn't even touch that part of Ogre.

Might be worth narrowing it down a little, the only things that NxOgre touches are:

Framelistener
SceneManager
RootSceneNode
SceneNode
And the bits for shapes; Mesh, terrain, convex, etc.

Could it be the frameListener, I wonder if you paused NxOgre before switching levels?

mnm23

24-08-2006 15:14:54

So it was a problem with nxOgre. Just not directly related. Right now im just testing the switching of the levels because we are doing some different stuff with which level it goes to and how and when. So i have the switching mapped to a key and i put this key hit function in the key pressed function ( forgot nxOgre doesnt like buffered input). So when i put it in my frameEnded function it worked fine( unbuffered). Maybe i have the unbuffered/buffered backwards there, not sure (LOL). In the end it now works. This is why i have none of my move functions in keyPressed/keyReleased. Thanks again guys.

betajaen

24-08-2006 15:24:59

NxOgre likes buffered and unbuffered. I've tried it with both with InputManager and OIS and it works fine.

You just have to get the forces right ;)


Glad you have it sorted out, you had me worried for a minute that NxOgre was a messy pup with Viewports.

mnm23

24-08-2006 15:33:12

Thats wierd then why can i not use any of my move functions for my keyboard, mouse, or joystick unless i put them in framStarted. Sorry thats a lie, I can use them they just react much much slower than when I have it in frameStarted. Not complaining that its working just trying to look beyond the current code.

betajaen

24-08-2006 16:29:07

It's because the forces are applied more times when it's unbuffered than buffered it seems quicker.