irishstu
25-07-2006 15:01:35
Hi - I'm having getting oFusion to work with VS
Specifically, I get errors when I try to enter the lines specified in Integrating Your Application"
Below is the code generated when I make a new Ogre project:
------------------------------------------------------------
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2005 The OGRE Team
Also see acknowledgements in Readme.html
You may use this sample code for anything you like, it is not covered by the
LGPL like the rest of the engine.
-----------------------------------------------------------------------------
*/
/*
-----------------------------------------------------------------------------
Filename: testMats2.h
Description: A place for me to try out stuff with OGRE.
-----------------------------------------------------------------------------
*/
#ifndef __testMats2_h_
#define __testMats2_h_
#include "ExampleApplication.h"
class testMats2FrameListener : public ExampleFrameListener
{
private:
SceneManager* mSceneMgr;
public:
testMats2FrameListener(SceneManager *sceneMgr, RenderWindow* win, Camera* cam)
: ExampleFrameListener(win, cam),
mSceneMgr(sceneMgr)
{
}
bool frameStarted(const FrameEvent& evt)
{
bool ret = ExampleFrameListener::frameStarted(evt);
return ret;
}
};
class testMats2App : public ExampleApplication
{
public:
testMats2App()
{}
~testMats2App()
{
}
protected:
virtual void createCamera(void)
{
// Create the camera
mCamera = mSceneMgr->createCamera("PlayerCam");
// Position it at 500 in Z direction
mCamera->setPosition(Vector3(0,0,80));
// Look back along -Z
mCamera->lookAt(Vector3(0,0,-300));
mCamera->setNearClipDistance(5);
}
// Just override the mandatory create scene method
virtual void createScene(void)
{
Entity* ogreHead = mSceneMgr->createEntity("Head", "OgreHead.mesh");
SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
headNode->attachObject(ogreHead);
// Set ambient light
mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
// Create a light
Light* l = mSceneMgr->createLight("MainLight");
l->setPosition(20,80,50);
}
// Create new frame listener
void createFrameListener(void)
{
mFrameListener= new testMats2FrameListener(mSceneMgr, mWindow, mCamera);
mRoot->addFrameListener(mFrameListener);
}
};
#endif // #ifndef __testMats2_h_
------------------------------------------------------------
What code do I put in to get my scene loaded, and where does it go?
(sorry if this is a dumb question, I'm only starting to learn this stufff!)
Specifically, I get errors when I try to enter the lines specified in Integrating Your Application"
Below is the code generated when I make a new Ogre project:
------------------------------------------------------------
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2005 The OGRE Team
Also see acknowledgements in Readme.html
You may use this sample code for anything you like, it is not covered by the
LGPL like the rest of the engine.
-----------------------------------------------------------------------------
*/
/*
-----------------------------------------------------------------------------
Filename: testMats2.h
Description: A place for me to try out stuff with OGRE.
-----------------------------------------------------------------------------
*/
#ifndef __testMats2_h_
#define __testMats2_h_
#include "ExampleApplication.h"
class testMats2FrameListener : public ExampleFrameListener
{
private:
SceneManager* mSceneMgr;
public:
testMats2FrameListener(SceneManager *sceneMgr, RenderWindow* win, Camera* cam)
: ExampleFrameListener(win, cam),
mSceneMgr(sceneMgr)
{
}
bool frameStarted(const FrameEvent& evt)
{
bool ret = ExampleFrameListener::frameStarted(evt);
return ret;
}
};
class testMats2App : public ExampleApplication
{
public:
testMats2App()
{}
~testMats2App()
{
}
protected:
virtual void createCamera(void)
{
// Create the camera
mCamera = mSceneMgr->createCamera("PlayerCam");
// Position it at 500 in Z direction
mCamera->setPosition(Vector3(0,0,80));
// Look back along -Z
mCamera->lookAt(Vector3(0,0,-300));
mCamera->setNearClipDistance(5);
}
// Just override the mandatory create scene method
virtual void createScene(void)
{
Entity* ogreHead = mSceneMgr->createEntity("Head", "OgreHead.mesh");
SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
headNode->attachObject(ogreHead);
// Set ambient light
mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
// Create a light
Light* l = mSceneMgr->createLight("MainLight");
l->setPosition(20,80,50);
}
// Create new frame listener
void createFrameListener(void)
{
mFrameListener= new testMats2FrameListener(mSceneMgr, mWindow, mCamera);
mRoot->addFrameListener(mFrameListener);
}
};
#endif // #ifndef __testMats2_h_
------------------------------------------------------------
What code do I put in to get my scene loaded, and where does it go?
(sorry if this is a dumb question, I'm only starting to learn this stufff!)