Skip to main content

History: BasicTutorial3Source

Source of version: 4

Copy to clipboard
            This is the source code for ((Basic Tutorial 3)). Please note that a majority of Basic Tutorial 3 was spent modifying code already put into the createScene member function. Please read the tutorial very carefully if you are having trouble with it.

{CODE(wrap="1",colors="c++")}
#include "ExampleApplication.h"

class TutorialApplication : public ExampleApplication
{
protected:
public:
    TutorialApplication()
    {
    }

    ~TutorialApplication() 
    {
    }
protected:
    void chooseSceneManager(void)
    {
        mSceneMgr = mRoot->createSceneManager(ST_EXTERIOR_CLOSE);
    }

    void createScene(void)
    {
        mSceneMgr->setWorldGeometry("terrain.cfg");
        //mSceneMgr->setSkyBox(true, "Examples/SpaceSkyBox");

        ColourValue fadeColour(0.9, 0.9, 0.9);
        mWindow->getViewport(0)->setBackgroundColour(fadeColour);
        mSceneMgr->setFog(FOG_LINEAR, fadeColour, 0.0, 50, 500);
    }
};

#if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"

INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
#else
int main(int argc, char **argv)
#endif
{
    // Create application object
    TutorialApplication app;

    try {
        app.go();
    } catch(Exception& e) {
#if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
        MessageBoxA(NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
        fprintf(stderr, "An exception has occurred: %s\n",
            e.getFullDescription().c_str());
#endif
    }

    return 0;
}
{CODE}
        

History

Information Version
Fri 19 of Apr, 2013 05:11 GMT-0000 everyday85 add code for handling the first layer blend map in "BasicTutorial3::initBlendMaps(Ogre::Terrain* terrain)" according to the BasicTutorial3. 10
Thu 26 of Aug, 2010 15:18 GMT-0000 progman Commented out Texture Filtering options. 9
Sun 20 of Jun, 2010 23:46 GMT-0000 jacmoe 8
Sun 20 of Jun, 2010 23:37 GMT-0000 jacmoe 7
Sun 20 of Jun, 2010 23:36 GMT-0000 jacmoe 6
Sun 20 of Jun, 2010 23:18 GMT-0000 jacmoe 5
Fri 29 of Jan, 2010 03:57 GMT-0000 peters remove extra space at column 0 4
Mon 04 of Jan, 2010 05:20 GMT-0000 jacmoe 3
Sun 06 of Dec, 2009 11:32 GMT-0000 jacmoe 2
Sun 12 of Oct, 2008 10:40 GMT-0000 OgreWikiBot Robot: Cosmetic changes 1