Error which breaks to Utility file

Jallen

27-01-2008 11:31:20

I have been following the OgreNewt tutorial, adding everything to my project, and i'm pretty sure everything is placed correctly. However when i do this:


mOgreNewtListener = new OgreNewt::BasicFrameListener( mWindow, mgr, mWorld, 120 );
mRoot->addFrameListener( mOgreNewtListener );


mRoot->addFrameListener( mOgreNewtListener );
^ This line breaks to a file called c:\program files\microsoft visual studio 8\vc\include\utility. All of the code in the createScene function does not show any bad values while debugging.

I get an access violation reading location error and it appears that _Val2 in the utility file is the bad pointer (says so in the autos window)
I am using VC++2005 Express.

Please help, I really can't proceed until i get this down and i don't have a clue...
Thanks, Jallen.

Oh yeah, I'm not doing this:
mOgreNewtListener = new OgreNewt::BasicFrameListener( mWindow, cam, mgr, mWorld, 120 );
like the tutorial says, because i just cant compile, it says no overloaded member function takes 5 arguments.
Oh, and im not using ExampleApplication.h

Jallen

29-01-2008 17:34:36

Has nobody got a solution?

dudeabot

29-01-2008 19:53:16

it works when you remove those lines?


mOgreNewtListener = new OgreNewt::BasicFrameListener( mWindow, mgr, mWorld, 120 );
mRoot->addFrameListener( mOgreNewtListener );


if so you can try implementing the framelistener logic that comes on basicFrameListener.cpp

basically you have to do this

on your framestarted method you do some logic with your timer (ie update how many times you want, again, you can have a look at the basicframelistener.cpp to have an idea)

heres some pseudo code


bool framestarted (){
if (..time logic..){
mWorld->update();
}
}

Jallen

30-01-2008 20:27:49

Cool, thanks i will try that tommorow.