IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Ogre Discussion :

La fenêtre de configuration ne s'affiche pas [Visual C++ 2010 Express]


Sujet :

Ogre

  1. #1
    Membre du Club
    Inscrit en
    Mars 2012
    Messages
    165
    Détails du profil
    Informations forums :
    Inscription : Mars 2012
    Messages : 165
    Points : 59
    Points
    59
    Par défaut La fenêtre de configuration ne s'affiche pas [Visual C++ 2010 Express]
    Bonjour,

    Je suis débutant en Ogre3D. J'ai crée ma première application Ogre3D et quand je compile, la génération se déroule bien

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Génération*: 1 a réussi, 0 a échoué, 0 mis à jour, 0 a été ignoré
    Sauf que la fenêtre de configuration de ogre3d ne s'affiche pas.

    Merci bien pour vos renseignements.

  2. #2
    Membre actif
    Homme Profil pro
    Développeur Web
    Inscrit en
    Juillet 2009
    Messages
    132
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Juillet 2009
    Messages : 132
    Points : 283
    Points
    283
    Par défaut
    Bonjour,

    Nous manquons d'informations pour pouvoir te répondre. La fenêtre de configuration ne s'affiche pas, mais est-ce que la fenêtre de rendu s'affiche correctement ?
    Pourrais-tu nous montrer un peu de ton code ? Ton code s'exécute correctement ? As-tu utilisé un débogueur pour voir si toutes tes instructions s'exécutent ?

  3. #3
    Membre du Club
    Inscrit en
    Mars 2012
    Messages
    165
    Détails du profil
    Informations forums :
    Inscription : Mars 2012
    Messages : 165
    Points : 59
    Points
    59
    Par défaut
    J'ai crée un projet Ogre3D, il y'a des fichiers générés automatiquement :

    - Fichiers d entete : BaseApplication.h, OgreApp2.h, Resource.h
    - Fichiers sources : BaseApplication.cpp, OgreApp2.cpp

    Voilà mon fichier OgreApp2.cpp :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    /*
    -----------------------------------------------------------------------------
    Filename:    OgreApp2.cpp
    -----------------------------------------------------------------------------
     
     
    This source file is generated by the
       ___                   _              __    __ _                  _ 
      /___\__ _ _ __ ___    /_\  _ __  _ __/ / /\ \ (_)______ _ _ __ __| |
     //  // _` | '__/ _ \  //_\\| '_ \| '_ \ \/  \/ / |_  / _` | '__/ _` |
    / \_// (_| | | |  __/ /  _  \ |_) | |_) \  /\  /| |/ / (_| | | | (_| |
    \___/ \__, |_|  \___| \_/ \_/ .__/| .__/ \/  \/ |_/___\__,_|_|  \__,_|
          |___/                 |_|   |_|                                 
          Ogre 1.8.x Application Wizard for VC10 (May 2012)
          https://bitbucket.org/jacmoe/ogreappwizards
    -----------------------------------------------------------------------------
    */
     
    #include "OgreApp2.h"
     
    //-------------------------------------------------------------------------------------
    OgreApp2::OgreApp2(void)
    {
    }
    //-------------------------------------------------------------------------------------
    OgreApp2::~OgreApp2(void)
    {
    }
     
    //-------------------------------------------------------------------------------------
    void OgreApp2::createScene(void)
    {
        Ogre::Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh");
     
        Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
        headNode->attachObject(ogreHead);
     
        // Set ambient light
        mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5));
     
        // Create a light
        Ogre::Light* l = mSceneMgr->createLight("MainLight");
        l->setPosition(20,80,50);
    }
     
     
     
    #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    #define WIN32_LEAN_AND_MEAN
    #include "windows.h"
    #endif
     
    #ifdef __cplusplus
    extern "C" {
    #endif
     
    #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
        INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
    #else
        int main(int argc, char *argv[])
    #endif
        {
            // Create application object
            OgreApp2 app;
     
            try {
                app.go();
            } catch( Ogre::Exception& e ) {
    #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
                MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
    #else
                std::cerr << "An exception has occured: " <<
                    e.getFullDescription().c_str() << std::endl;
    #endif
            }
     
            return 0;
        }
     
    #ifdef __cplusplus
    }
    #endif
    Voilà mon fichier BaseApplication.cpp :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    /*
    -----------------------------------------------------------------------------
    Filename:    BaseApplication.cpp
    -----------------------------------------------------------------------------
     
     
    This source file is generated by the
       ___                   _              __    __ _                  _ 
      /___\__ _ _ __ ___    /_\  _ __  _ __/ / /\ \ (_)______ _ _ __ __| |
     //  // _` | '__/ _ \  //_\\| '_ \| '_ \ \/  \/ / |_  / _` | '__/ _` |
    / \_// (_| | | |  __/ /  _  \ |_) | |_) \  /\  /| |/ / (_| | | | (_| |
    \___/ \__, |_|  \___| \_/ \_/ .__/| .__/ \/  \/ |_/___\__,_|_|  \__,_|
          |___/                 |_|   |_|                                 
          Ogre 1.8.x Application Wizard for VC10 (May 2012)
          https://bitbucket.org/jacmoe/ogreappwizards
    -----------------------------------------------------------------------------
    */
    #include "BaseApplication.h"
     
    #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    #include "../res/resource.h"
    #endif
     
     
    //-------------------------------------------------------------------------------------
    BaseApplication::BaseApplication(void)
        : mRoot(0),
        mCamera(0),
        mSceneMgr(0),
        mWindow(0),
        mResourcesCfg(Ogre::StringUtil::BLANK),
        mPluginsCfg(Ogre::StringUtil::BLANK),
        mTrayMgr(0),
        mCameraMan(0),
        mDetailsPanel(0),
        mCursorWasVisible(false),
        mShutDown(false),
        mInputManager(0),
        mMouse(0),
        mKeyboard(0)
    {
    }
     
    //-------------------------------------------------------------------------------------
    BaseApplication::~BaseApplication(void)
    {
        if (mTrayMgr) delete mTrayMgr;
        if (mCameraMan) delete mCameraMan;
     
        //Remove ourself as a Window listener
        Ogre::WindowEventUtilities::removeWindowEventListener(mWindow, this);
        windowClosed(mWindow);
        delete mRoot;
    }
     
    //-------------------------------------------------------------------------------------
    bool BaseApplication::configure(void)
    {
        // Show the configuration dialog and initialise the system
        // You can skip this and use root.restoreConfig() to load configuration
        // settings if you were sure there are valid ones saved in ogre.cfg
        if(mRoot->showConfigDialog())
        {
            // If returned true, user clicked OK so initialise
            // Here we choose to let the system create a default rendering window by passing 'true'
            mWindow = mRoot->initialise(true, "OgreApp2 Render Window");
     
            // Let's add a nice window icon
    #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
            HWND hwnd;
            mWindow->getCustomAttribute("WINDOW", (void*)&hwnd);
            LONG iconID   = (LONG)LoadIcon( GetModuleHandle(0), MAKEINTRESOURCE(IDI_APPICON) );
            SetClassLong( hwnd, GCL_HICON, iconID );
    #endif
            return true;
        }
        else
        {
            return false;
        }
    }
    //-------------------------------------------------------------------------------------
    void BaseApplication::chooseSceneManager(void)
    {
        // Get the SceneManager, in this case a generic one
        mSceneMgr = mRoot->createSceneManager(Ogre::ST_GENERIC);
    }
    //-------------------------------------------------------------------------------------
    void BaseApplication::createCamera(void)
    {
        // Create the camera
        mCamera = mSceneMgr->createCamera("PlayerCam");
     
        // Position it at 500 in Z direction
        mCamera->setPosition(Ogre::Vector3(0,0,80));
        // Look back along -Z
        mCamera->lookAt(Ogre::Vector3(0,0,-300));
        mCamera->setNearClipDistance(5);
     
        mCameraMan = new OgreBites::SdkCameraMan(mCamera);   // create a default camera controller
    }
    //-------------------------------------------------------------------------------------
    void BaseApplication::createFrameListener(void)
    {
        Ogre::LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
        OIS::ParamList pl;
        size_t windowHnd = 0;
        std::ostringstream windowHndStr;
     
        mWindow->getCustomAttribute("WINDOW", &windowHnd);
        windowHndStr << windowHnd;
        pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
     
        mInputManager = OIS::InputManager::createInputSystem( pl );
     
        mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, true ));
        mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, true ));
     
        mMouse->setEventCallback(this);
        mKeyboard->setEventCallback(this);
     
        //Set initial mouse clipping size
        windowResized(mWindow);
     
        //Register as a Window listener
        Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this);
     
        mTrayMgr = new OgreBites::SdkTrayManager("InterfaceName", mWindow, mMouse, this);
        mTrayMgr->showFrameStats(OgreBites::TL_BOTTOMLEFT);
        mTrayMgr->showLogo(OgreBites::TL_BOTTOMRIGHT);
        mTrayMgr->hideCursor();
     
        // create a params panel for displaying sample details
        Ogre::StringVector items;
        items.push_back("cam.pX");
        items.push_back("cam.pY");
        items.push_back("cam.pZ");
        items.push_back("");
        items.push_back("cam.oW");
        items.push_back("cam.oX");
        items.push_back("cam.oY");
        items.push_back("cam.oZ");
        items.push_back("");
        items.push_back("Filtering");
        items.push_back("Poly Mode");
     
        mDetailsPanel = mTrayMgr->createParamsPanel(OgreBites::TL_NONE, "DetailsPanel", 200, items);
        mDetailsPanel->setParamValue(9, "Bilinear");
        mDetailsPanel->setParamValue(10, "Solid");
        mDetailsPanel->hide();
     
        mRoot->addFrameListener(this);
    }
    //-------------------------------------------------------------------------------------
    void BaseApplication::destroyScene(void)
    {
    }
    //-------------------------------------------------------------------------------------
    void BaseApplication::createViewports(void)
    {
        // Create one viewport, entire window
        Ogre::Viewport* vp = mWindow->addViewport(mCamera);
        vp->setBackgroundColour(Ogre::ColourValue(0,0,0));
     
        // Alter the camera aspect ratio to match the viewport
        mCamera->setAspectRatio(
            Ogre::Real(vp->getActualWidth()) / Ogre::Real(vp->getActualHeight()));
    }
    //-------------------------------------------------------------------------------------
    void BaseApplication::setupResources(void)
    {
        // Load resource paths from config file
        Ogre::ConfigFile cf;
        cf.load(mResourcesCfg);
     
        // Go through all sections & settings in the file
        Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
     
        Ogre::String secName, typeName, archName;
        while (seci.hasMoreElements())
        {
            secName = seci.peekNextKey();
            Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
            Ogre::ConfigFile::SettingsMultiMap::iterator i;
            for (i = settings->begin(); i != settings->end(); ++i)
            {
                typeName = i->first;
                archName = i->second;
                Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
                    archName, typeName, secName);
            }
        }
    }
    //-------------------------------------------------------------------------------------
    void BaseApplication::createResourceListener(void)
    {
     
    }
    //-------------------------------------------------------------------------------------
    void BaseApplication::loadResources(void)
    {
        Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
    }
    //-------------------------------------------------------------------------------------
    void BaseApplication::go(void)
    {
    #ifdef _DEBUG
        mResourcesCfg = "resources_d.cfg";
        mPluginsCfg = "plugins_d.cfg";
    #else
        mResourcesCfg = "resources.cfg";
        mPluginsCfg = "plugins.cfg";
    #endif
     
        if (!setup())
            return;
     
        mRoot->startRendering();
     
        // clean up
        destroyScene();
    }
    //-------------------------------------------------------------------------------------
    bool BaseApplication::setup(void)
    {
        mRoot = new Ogre::Root(mPluginsCfg);
     
        setupResources();
     
        bool carryOn = configure();
        if (!carryOn) return false;
     
        chooseSceneManager();
        createCamera();
        createViewports();
     
        // Set default mipmap level (NB some APIs ignore this)
        Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
     
        // Create any resource listeners (for loading screens)
        createResourceListener();
        // Load resources
        loadResources();
     
        // Create the scene
        createScene();
     
        createFrameListener();
     
    	return true;
    };
    //-------------------------------------------------------------------------------------
    bool BaseApplication::frameRenderingQueued(const Ogre::FrameEvent& evt)
    {
        if(mWindow->isClosed())
            return false;
     
        if(mShutDown)
            return false;
     
        //Need to capture/update each device
        mKeyboard->capture();
        mMouse->capture();
     
        mTrayMgr->frameRenderingQueued(evt);
     
        if (!mTrayMgr->isDialogVisible())
        {
            mCameraMan->frameRenderingQueued(evt);   // if dialog isn't up, then update the camera
            if (mDetailsPanel->isVisible())   // if details panel is visible, then update its contents
            {
                mDetailsPanel->setParamValue(0, Ogre::StringConverter::toString(mCamera->getDerivedPosition().x));
                mDetailsPanel->setParamValue(1, Ogre::StringConverter::toString(mCamera->getDerivedPosition().y));
                mDetailsPanel->setParamValue(2, Ogre::StringConverter::toString(mCamera->getDerivedPosition().z));
                mDetailsPanel->setParamValue(4, Ogre::StringConverter::toString(mCamera->getDerivedOrientation().w));
                mDetailsPanel->setParamValue(5, Ogre::StringConverter::toString(mCamera->getDerivedOrientation().x));
                mDetailsPanel->setParamValue(6, Ogre::StringConverter::toString(mCamera->getDerivedOrientation().y));
                mDetailsPanel->setParamValue(7, Ogre::StringConverter::toString(mCamera->getDerivedOrientation().z));
            }
        }
     
        return true;
    }
    //-------------------------------------------------------------------------------------
    bool BaseApplication::keyPressed( const OIS::KeyEvent &arg )
    {
        if (mTrayMgr->isDialogVisible()) return true;   // don't process any more keys if dialog is up
     
        if (arg.key == OIS::KC_F)   // toggle visibility of advanced frame stats
        {
            mTrayMgr->toggleAdvancedFrameStats();
        }
        else if (arg.key == OIS::KC_G)   // toggle visibility of even rarer debugging details
        {
            if (mDetailsPanel->getTrayLocation() == OgreBites::TL_NONE)
            {
                mTrayMgr->moveWidgetToTray(mDetailsPanel, OgreBites::TL_TOPRIGHT, 0);
                mDetailsPanel->show();
            }
            else
            {
                mTrayMgr->removeWidgetFromTray(mDetailsPanel);
                mDetailsPanel->hide();
            }
        }
        else if (arg.key == OIS::KC_T)   // cycle polygon rendering mode
        {
            Ogre::String newVal;
            Ogre::TextureFilterOptions tfo;
            unsigned int aniso;
     
            switch (mDetailsPanel->getParamValue(9).asUTF8()[0])
            {
            case 'B':
                newVal = "Trilinear";
                tfo = Ogre::TFO_TRILINEAR;
                aniso = 1;
                break;
            case 'T':
                newVal = "Anisotropic";
                tfo = Ogre::TFO_ANISOTROPIC;
                aniso = 8;
                break;
            case 'A':
                newVal = "None";
                tfo = Ogre::TFO_NONE;
                aniso = 1;
                break;
            default:
                newVal = "Bilinear";
                tfo = Ogre::TFO_BILINEAR;
                aniso = 1;
            }
     
            Ogre::MaterialManager::getSingleton().setDefaultTextureFiltering(tfo);
            Ogre::MaterialManager::getSingleton().setDefaultAnisotropy(aniso);
            mDetailsPanel->setParamValue(9, newVal);
        }
        else if (arg.key == OIS::KC_R)   // cycle polygon rendering mode
        {
            Ogre::String newVal;
            Ogre::PolygonMode pm;
     
            switch (mCamera->getPolygonMode())
            {
            case Ogre::PM_SOLID:
                newVal = "Wireframe";
                pm = Ogre::PM_WIREFRAME;
                break;
            case Ogre::PM_WIREFRAME:
                newVal = "Points";
                pm = Ogre::PM_POINTS;
                break;
            default:
                newVal = "Solid";
                pm = Ogre::PM_SOLID;
            }
     
            mCamera->setPolygonMode(pm);
            mDetailsPanel->setParamValue(10, newVal);
        }
        else if(arg.key == OIS::KC_F5)   // refresh all textures
        {
            Ogre::TextureManager::getSingleton().reloadAll();
        }
        else if (arg.key == OIS::KC_SYSRQ)   // take a screenshot
        {
            mWindow->writeContentsToTimestampedFile("screenshot", ".jpg");
        }
        else if (arg.key == OIS::KC_ESCAPE)
        {
            mShutDown = true;
        }
     
        mCameraMan->injectKeyDown(arg);
        return true;
    }
     
    bool BaseApplication::keyReleased( const OIS::KeyEvent &arg )
    {
        mCameraMan->injectKeyUp(arg);
        return true;
    }
     
    bool BaseApplication::mouseMoved( const OIS::MouseEvent &arg )
    {
        if (mTrayMgr->injectMouseMove(arg)) return true;
        mCameraMan->injectMouseMove(arg);
        return true;
    }
     
    bool BaseApplication::mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
    {
        if (mTrayMgr->injectMouseDown(arg, id)) return true;
        mCameraMan->injectMouseDown(arg, id);
        return true;
    }
     
    bool BaseApplication::mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
    {
        if (mTrayMgr->injectMouseUp(arg, id)) return true;
        mCameraMan->injectMouseUp(arg, id);
        return true;
    }
     
    //Adjust mouse clipping area
    void BaseApplication::windowResized(Ogre::RenderWindow* rw)
    {
        unsigned int width, height, depth;
        int left, top;
        rw->getMetrics(width, height, depth, left, top);
     
        const OIS::MouseState &ms = mMouse->getMouseState();
        ms.width = width;
        ms.height = height;
    }
     
    //Unattach OIS before window shutdown (very important under Linux)
    void BaseApplication::windowClosed(Ogre::RenderWindow* rw)
    {
        //Only close for window that created OIS (the main window in these demos)
        if( rw == mWindow )
        {
            if( mInputManager )
            {
                mInputManager->destroyInputObject( mMouse );
                mInputManager->destroyInputObject( mKeyboard );
     
                OIS::InputManager::destroyInputSystem(mInputManager);
                mInputManager = 0;
            }
        }
    }
    Voilà mon fichier BaseApplication.h :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    /*
    -----------------------------------------------------------------------------
    Filename:    BaseApplication.h
    -----------------------------------------------------------------------------
     
     
    This source file is generated by the
       ___                   _              __    __ _                  _ 
      /___\__ _ _ __ ___    /_\  _ __  _ __/ / /\ \ (_)______ _ _ __ __| |
     //  // _` | '__/ _ \  //_\\| '_ \| '_ \ \/  \/ / |_  / _` | '__/ _` |
    / \_// (_| | | |  __/ /  _  \ |_) | |_) \  /\  /| |/ / (_| | | | (_| |
    \___/ \__, |_|  \___| \_/ \_/ .__/| .__/ \/  \/ |_/___\__,_|_|  \__,_|
          |___/                 |_|   |_|                                 
          Ogre 1.8.x Application Wizard for VC10 (May 2012)
          https://bitbucket.org/jacmoe/ogreappwizards
    -----------------------------------------------------------------------------
    */
    #ifndef __BaseApplication_h_
    #define __BaseApplication_h_
     
    #include <OgreCamera.h>
    #include <OgreEntity.h>
    #include <OgreLogManager.h>
    #include <OgreRoot.h>
    #include <OgreViewport.h>
    #include <OgreSceneManager.h>
    #include <OgreRenderWindow.h>
    #include <OgreConfigFile.h>
     
    #include <OISEvents.h>
    #include <OISInputManager.h>
    #include <OISKeyboard.h>
    #include <OISMouse.h>
     
    #include <SdkTrays.h>
    #include <SdkCameraMan.h>
     
    class BaseApplication : public Ogre::FrameListener, public Ogre::WindowEventListener, public OIS::KeyListener, public OIS::MouseListener, OgreBites::SdkTrayListener
    {
    public:
        BaseApplication(void);
        virtual ~BaseApplication(void);
     
        virtual void go(void);
     
    protected:
        virtual bool setup();
        virtual bool configure(void);
        virtual void chooseSceneManager(void);
        virtual void createCamera(void);
        virtual void createFrameListener(void);
        virtual void createScene(void) = 0; // Override me!
        virtual void destroyScene(void);
        virtual void createViewports(void);
        virtual void setupResources(void);
        virtual void createResourceListener(void);
        virtual void loadResources(void);
     
        // Ogre::FrameListener
        virtual bool frameRenderingQueued(const Ogre::FrameEvent& evt);
     
        // OIS::KeyListener
        virtual bool keyPressed( const OIS::KeyEvent &arg );
        virtual bool keyReleased( const OIS::KeyEvent &arg );
        // OIS::MouseListener
        virtual bool mouseMoved( const OIS::MouseEvent &arg );
        virtual bool mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
        virtual bool mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
     
        // Ogre::WindowEventListener
        //Adjust mouse clipping area
        virtual void windowResized(Ogre::RenderWindow* rw);
        //Unattach OIS before window shutdown (very important under Linux)
        virtual void windowClosed(Ogre::RenderWindow* rw);
     
        Ogre::Root *mRoot;
        Ogre::Camera* mCamera;
        Ogre::SceneManager* mSceneMgr;
        Ogre::RenderWindow* mWindow;
        Ogre::String mResourcesCfg;
        Ogre::String mPluginsCfg;
     
        // OgreBites
        OgreBites::SdkTrayManager* mTrayMgr;
        OgreBites::SdkCameraMan* mCameraMan;     // basic camera controller
        OgreBites::ParamsPanel* mDetailsPanel;   // sample details panel
        bool mCursorWasVisible;                  // was cursor visible before dialog appeared
        bool mShutDown;
     
        //OIS Input devices
        OIS::InputManager* mInputManager;
        OIS::Mouse*    mMouse;
        OIS::Keyboard* mKeyboard;
    };
     
    #endif // #ifndef __BaseApplication_h_
    Voilà mon fichier OgreApp2.h :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    /*
    -----------------------------------------------------------------------------
    Filename:    OgreApp2.h
    -----------------------------------------------------------------------------
     
     
    This source file is generated by the
       ___                   _              __    __ _                  _ 
      /___\__ _ _ __ ___    /_\  _ __  _ __/ / /\ \ (_)______ _ _ __ __| |
     //  // _` | '__/ _ \  //_\\| '_ \| '_ \ \/  \/ / |_  / _` | '__/ _` |
    / \_// (_| | | |  __/ /  _  \ |_) | |_) \  /\  /| |/ / (_| | | | (_| |
    \___/ \__, |_|  \___| \_/ \_/ .__/| .__/ \/  \/ |_/___\__,_|_|  \__,_|
          |___/                 |_|   |_|                                 
          Ogre 1.8.x Application Wizard for VC10 (May 2012)
          https://bitbucket.org/jacmoe/ogreappwizards
    -----------------------------------------------------------------------------
    */
    #ifndef __OgreApp2_h_
    #define __OgreApp2_h_
     
    #include "BaseApplication.h"
    #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    #include "../res/resource.h"
    #endif
     
     
    class OgreApp2 : public BaseApplication
    {
    public:
        OgreApp2(void);
        virtual ~OgreApp2(void);
     
    protected:
        virtual void createScene(void);
    };
     
    #endif // #ifndef __OgreApp2_h_

Discussions similaires

  1. Réponses: 3
    Dernier message: 31/08/2014, 13h10
  2. [Primefaces]la fenêtre de dialogue ne s'affiche pas
    Par syrine Jerbi dans le forum JSF
    Réponses: 4
    Dernier message: 23/03/2014, 14h12
  3. Réponses: 2
    Dernier message: 06/09/2010, 22h33
  4. Fenêtres pop-up qui n'affiche pas de données
    Par tresorkoul dans le forum JDeveloper
    Réponses: 7
    Dernier message: 25/09/2009, 14h48

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo