Partage
  • Partager sur Facebook
  • Partager sur Twitter

[Ogre] PB de configuration sous Code Blocks

    16 août 2007 à 15:43:54

    Salut

    J'ai suivis le tuto suivant tuto pur installer Ogre sous Vista, mais le problème est les messages d'erreurs qui apparaissent lorsque je compile sous Code Blocks.

    Image utilisateur

    1. // ----------------------------------------------------------------------------
    2. // Include the main OGRE header files
    3. // Ogre.h just expands to including lots of individual OGRE header files
    4. // ----------------------------------------------------------------------------
    5. #include <Ogre.h>
    6. // ----------------------------------------------------------------------------
    7. // Include the OGRE example framework
    8. // This includes the classes defined to make getting an OGRE application running
    9. // a lot easier. It automatically sets up all the main objects and allows you to
    10. // just override the bits you want to instead of writing it all from scratch.
    11. // ----------------------------------------------------------------------------
    12. #include <ExampleApplication.h>
    13. // ----------------------------------------------------------------------------
    14. // Define the application object
    15. // This is derived from ExampleApplication which is the class OGRE provides to
    16. // make it easier to set up OGRE without rewriting the same code all the time.
    17. // You can override extra methods of ExampleApplication if you want to further
    18. // specialise the setup routine, otherwise the only mandatory override is the
    19. // 'createScene' method which is where you set up your own personal scene.
    20. // ----------------------------------------------------------------------------
    21. class SampleApp : public ExampleApplication
    22. {
    23. public:
    24.     // Basic constructor
    25.     SampleApp()
    26.     {}
    27. protected:
    28.     // Just override the mandatory create scene method
    29.     void createScene(void)
    30.     {
    31.         // Create the SkyBox
    32.         mSceneMgr->setSkyBox(true, "Examples/CloudyNoonSkyBox");
    33.         // Create a light
    34.         Light* myLight = mSceneMgr->createLight("Light0");
    35.         myLight->setType(Light::LT_POINT);
    36.         myLight->setPosition(0, 40, 0);
    37.         myLight->setDiffuseColour(1, 1, 1);
    38.         myLight->setSpecularColour(1, 1, 1);
    39.     }
    40. };
    41. // ----------------------------------------------------------------------------
    42. // Main function, just boots the application object
    43. // ----------------------------------------------------------------------------
    44. #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    45. #define WIN32_LEAN_AND_MEAN
    46. #include "windows.h"
    47. INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
    48. #else
    49. int main(int argc, char **argv)
    50. #endif
    51. {
    52.     // Create application object
    53.     SampleApp app;
    54.     try
    55.     {
    56.         app.go();
    57.     }
    58.     catch( Exception& e )
    59.     {
    60. #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    61.         MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
    62. #else
    63.         std::cerr << "An exception has occured: " << e.getFullDescription();
    64. #endif
    65.     }
    66.     return 0;
    67. }


    Merci d'Avance

    deltaOne
    • Partager sur Facebook
    • Partager sur Twitter
      16 août 2007 à 15:48:11

      Quand ca m'arrive c'est que j'oublie d'inclure les lib ou qu'une dll est absente
      • Partager sur Facebook
      • Partager sur Twitter
        16 août 2007 à 17:24:14

        Ok, mais comment inclure ces lib ou les dll ou alors comment savoir qu'il y a quelque chose qui manque ? Moi je crois que j'ai bien suivis le tuto mais ça marche pas.

        deltaOne
        • Partager sur Facebook
        • Partager sur Twitter
          16 août 2007 à 17:54:53

          Es-ce que tu a linker la lib de ogre ???? c'est peut-etre ca le probleme aussi ... ^^
          • Partager sur Facebook
          • Partager sur Twitter
            16 août 2007 à 18:04:44

            Je ne sais pas !! j'ai juste suivis les instructions dans le tuto mais je ne sais pas ce que j'ai fait.

            Tu peux svp m'indiquer comment linker ?

            deltaOne
            • Partager sur Facebook
            • Partager sur Twitter
              17 août 2007 à 22:27:49

              Salut

              Je ne sais pas encore d'ou provient le problème et je souhaite que quelqu'un me donne quelques captures d'écran parceque moi je trouve Codeblocks difficile à configurer !!

              deltaOne
              • Partager sur Facebook
              • Partager sur Twitter
                18 août 2007 à 20:30:12

                Ce que je comprend pas c'est les erreurs à la ligne 78 alors que le code montré en montre que 76 !? .. Je sais que COde::Block est toujours retissant quand il a pas sa dernière ligne vide mais je pense pas que là il grogne pour 2 lignes ^^
                Bref je vois pas ..
                • Partager sur Facebook
                • Partager sur Twitter
                  18 août 2007 à 21:25:36

                  Salut

                  J'ai pas remarquer ça !!

                  Il donne TOUJOURS une erreure à la ligne 78 meme si je laisse des lignes vides ou je l'ai suppriment. Il donne l'erreur hors le main et à l'extérieure de toute fonction !!

                  deltaOne
                  • Partager sur Facebook
                  • Partager sur Twitter
                    18 août 2007 à 21:29:46

                    Salut,

                    Il faut que tu link la bibliothèque OIS qui sert à gérer les entrées.
                    Regarde le manuel de Code::Block pour savoir comment faire ou cherche dans les propriétés de ton projet ça doit pas être très compliqué à faire.

                    ++
                    • Partager sur Facebook
                    • Partager sur Twitter
                      20 août 2007 à 0:43:15

                      J'ai lu le manuel en anglais et j'ai pu rien faire, je ne sais pas s'il contient la solution ou alors c'est moi qui ne la pas trouver.

                      Aidez-moi svp
                      • Partager sur Facebook
                      • Partager sur Twitter
                        20 août 2007 à 11:59:17

                        Salut,

                        Commence par télécharger OIS ici.
                        Ensuite va voit la FAQ de Code::Block ici pour savoir comment linker ta librairie.

                        Je te souhaites bon courage pour ton projet, tu en auras besoin si tu bloques déjà à ce niveau là.

                        ++
                        • Partager sur Facebook
                        • Partager sur Twitter
                          20 août 2007 à 12:12:33

                          J'avais les mêmes problèmes, ne t'inquiète pas c'est tout à fait corrigeable.
                          Essaie de compiler un exemple donné avec le SDK. Quand tu arriveras à un compiler un, va voir dans les options du projets celles du linker, des chemins d'inclusions (des cibles Release et Debug), note tout ça puis crée toi un projet vide avec ces options puis enregistre te le en tant que projet utilisateur :) .
                          • Partager sur Facebook
                          • Partager sur Twitter
                            21 août 2007 à 20:54:48

                            Salut

                            J'ai télécharger la SDK, OIS et maintenant je suis coincé !!! Comment diable la compiler ??? sinon j'ai pas arrivé à faire rien du tout.

                            deltaOne
                            • Partager sur Facebook
                            • Partager sur Twitter
                              22 août 2007 à 8:47:38

                              Bonjour,
                              Moi aussi je viens d'installer Ogre3d, et j'ai le même message d'erreur:
                              Image utilisateur
                              J'ai téléchargé OIS mais y a pas un seul fichier .lib dessus.
                              Bon, je vais chercher un peu sur google
                              @+
                              • Partager sur Facebook
                              • Partager sur Twitter
                                22 août 2007 à 11:57:06

                                Salut,

                                Il y a un fichier ReadMe.txt dans ce que tu viens de télécharger, tu ouvrez et tu verras qu'il y a des instructions pour compiler ton projet, on y parle des dépendances et on te précise qu'il existe un projet pour Code::Block justement, donc tu vas dans le répertoire Win32, tu charge le projet Code::Block et tu compiles, tout le travail a été fait pour toi normalement.

                                ++
                                • Partager sur Facebook
                                • Partager sur Twitter
                                  22 août 2007 à 16:57:18

                                  salut

                                  Merci pour les réponses surtout les MPs.
                                  J'ai voulu compiler et executer src/Bezier.cpp dans OgreSDK/simples. Dans l'onglet Linker Settings Project -> build options, j'ai marquer OgreMain et ois puis ça me donne ça :

                                  Image utilisateurImage utilisateur

                                  Voila, j'attend vos suggestions ...

                                  deltaOne
                                  • Partager sur Facebook
                                  • Partager sur Twitter
                                    23 août 2007 à 9:06:39

                                    Salut,
                                    ben ça avance, t'as réussi à compiler.
                                    J'ai déjà testé la SDL sous vista mais pas Ogre3d, y a pas de problèmes normalement...
                                    Là j'ai vu sur la fenêtre d'erreur que tu compilais sous code::blocks avec microsft visual C++ runtime librairie.
                                    Alors je sais pas si c'est ça mais bon, on va essayer:
                                    dans code::blocks, ouvre ton projet, puis en haut clique sur project -> build options
                                    en haut de la fenêtre crée, il y a Selected compiler, choisis GNU GCC Compiler
                                    voilà, j'espère que c'est aussi simple sinon je sais pas.
                                    • Partager sur Facebook
                                    • Partager sur Twitter
                                      23 août 2007 à 10:33:44

                                      Si ça peut t'aider voici le portail français d'Ogre3D
                                      • Partager sur Facebook
                                      • Partager sur Twitter
                                        24 août 2007 à 2:59:02

                                        Salut

                                        J'ai essayer ce code :

                                        1. // ----------------------------------------------------------------------------
                                        2. // Include the main OGRE header files
                                        3. // Ogre.h just expands to including lots of individual OGRE header files
                                        4. // ----------------------------------------------------------------------------
                                        5. #include <Ogre.h>
                                        6. // ----------------------------------------------------------------------------
                                        7. // Include the OGRE example framework
                                        8. // This includes the classes defined to make getting an OGRE application running
                                        9. // a lot easier. It automatically sets up all the main objects and allows you to
                                        10. // just override the bits you want to instead of writing it all from scratch.
                                        11. // ----------------------------------------------------------------------------
                                        12. #include <ExampleApplication.h>
                                        13. // ----------------------------------------------------------------------------
                                        14. // Define the application object
                                        15. // This is derived from ExampleApplication which is the class OGRE provides to
                                        16. // make it easier to set up OGRE without rewriting the same code all the time.
                                        17. // You can override extra methods of ExampleApplication if you want to further
                                        18. // specialise the setup routine, otherwise the only mandatory override is the
                                        19. // 'createScene' method which is where you set up your own personal scene.
                                        20. // ----------------------------------------------------------------------------
                                        21. class SampleApp : public ExampleApplication
                                        22. {
                                        23. public:
                                        24.     // Basic constructor
                                        25.     SampleApp()
                                        26.     {}
                                        27. protected:
                                        28.     // Just override the mandatory create scene method
                                        29.     void createScene(void)
                                        30.     {
                                        31.         // Create the SkyBox
                                        32.         mSceneMgr->setSkyBox(true, "Examples/CloudyNoonSkyBox");
                                        33.         // Create a light
                                        34.         Light* myLight = mSceneMgr->createLight("Light0");
                                        35.         myLight->setType(Light::LT_POINT);
                                        36.         myLight->setPosition(0, 40, 0);
                                        37.         myLight->setDiffuseColour(1, 1, 1);
                                        38.         myLight->setSpecularColour(1, 1, 1);
                                        39.     }
                                        40. };
                                        41. // ----------------------------------------------------------------------------
                                        42. // Main function, just boots the application object
                                        43. // ----------------------------------------------------------------------------
                                        44. #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
                                        45. #define WIN32_LEAN_AND_MEAN
                                        46. #include "windows.h"
                                        47. INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
                                        48. #else
                                        49. int main(int argc, char **argv)
                                        50. #endif
                                        51. {
                                        52.     // Create application object
                                        53.     SampleApp app;
                                        54.     try
                                        55.     {
                                        56.         app.go();
                                        57.     }
                                        58.     catch( Exception& e )
                                        59.     {
                                        60. #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
                                        61.         MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
                                        62. #else
                                        63.         std::cerr << "An exception has occured: " << e.getFullDescription();
                                        64. #endif
                                        65.     }
                                        66.     return 0;
                                        67. }


                                        puis je choisis Build and run, il me donne le message suivant :

                                        Image utilisateur

                                        Je fait oui, il compile mais n'exécute rien !!
                                        Voila ce que j'ai dans Build log :

                                        1. -------------- Build: Debug in proj2 ---------------
                                        2. Linking executable: D:\OgreSDK\bin\Debug\proj2.exe
                                        3. d000059.o: multiple definition of `_imp___ZN4Ogre10Quaternion8IDENTITYE'
                                        4. Info: resolving __ZN4Ogre20ResourceGroupManager27DEFAULT_RESOURCE_GROUP_NAMEE by linking to __imp___ZN4Ogre20ResourceGroupManager27DEFAULT_RESOURCE_GROUP_NAMEE (auto-import)
                                        5. d000007.o: first defined here
                                        6. Info: resolving __ZN4Ogre10Quaternion8IDENTITYE by linking to __imp___ZN4Ogre10Quaternion8IDENTITYE (auto-import)
                                        7. d000059.o: multiple definition of `_nm___ZN4Ogre10Quaternion8IDENTITYE'
                                        8. Info: resolving __ZN4Ogre7Vector34ZEROE by linking to __imp___ZN4Ogre7Vector34ZEROE (auto-import)
                                        9. d000007.o: first defined here
                                        10. Info: resolving __ZN4Ogre4Math8fDeg2RadE by linking to __imp___ZN4Ogre4Math8fDeg2RadE (auto-import)
                                        11. d000060.o: multiple definition of `_imp___ZN4Ogre20ResourceGroupManager27DEFAULT_RESOURCE_GROUP_NAMEE'
                                        12. d000021.o: first defined here
                                        13. d000060.o: multiple definition of `_nm___ZN4Ogre20ResourceGroupManager27DEFAULT_RESOURCE_GROUP_NAMEE'
                                        14. d000021.o: first defined here
                                        15. d000061.o: multiple definition of `_imp___ZN4Ogre4Math8fDeg2RadE'
                                        16. d000025.o: first defined here
                                        17. d000061.o: multiple definition of `_nm___ZN4Ogre4Math8fDeg2RadE'
                                        18. d000025.o: first defined here
                                        19. d000062.o: multiple definition of `_imp___ZN4Ogre7Vector34ZEROE'
                                        20. d000045.o: first defined here
                                        21. d000062.o: multiple definition of `_nm___ZN4Ogre7Vector34ZEROE'
                                        22. d000045.o: first defined here
                                        23. Process terminated with status 1 (0 minutes, 1 seconds)
                                        24. 0 errors, 0 warnings


                                        Si ça marche pas indiquer moi svp se qui manque, si oui j'ai rien comme résultat (animation ou autre chose) si quelqu'un peut me donner un code qui génère un demo pour le tester à la place de celui là pour voir si tout va bien ou manque autre chose de plus...

                                        Je fait le maximum pour vous répondre au plus proche délais.

                                        deltaOne
                                        • Partager sur Facebook
                                        • Partager sur Twitter
                                          25 août 2007 à 3:28:50

                                          Bonjour

                                          J'ai pas réussi, SOS...

                                          deltaOne
                                          • Partager sur Facebook
                                          • Partager sur Twitter
                                            26 août 2007 à 19:47:17

                                            Salut

                                            Le problème je l'ai encore.

                                            deltaOne
                                            • Partager sur Facebook
                                            • Partager sur Twitter
                                              25 septembre 2007 à 1:16:39

                                              Salut

                                              J'ai voulu tester une démo pour savoir si j'ai tout bien configurer, voilà le code source de cette démo que j'ai trouver dans Samples :

                                              1. /*
                                              2. -----------------------------------------------------------------------------
                                              3. This source file is part of OGRE
                                              4.     (Object-oriented Graphics Rendering Engine)
                                              5. For the latest info, see http://www.ogre3d.org/
                                              6. Copyright (c) 2000-2006 Torus Knot Software Ltd
                                              7. Also see acknowledgements in Readme.html
                                              8. You may use this sample code for anything you like, it is not covered by the
                                              9. LGPL like the rest of the engine.
                                              10. -----------------------------------------------------------------------------
                                              11. */
                                              12. /**
                                              13.     \file
                                              14.         Shadows.cpp
                                              15.     \brief
                                              16.         Shows a few ways to use Ogre's shadowing techniques
                                              17. */
                                              18. #include <CEGUI/CEGUIImageset.h>
                                              19. #include <CEGUI/CEGUISystem.h>
                                              20. #include <CEGUI/CEGUILogger.h>
                                              21. #include <CEGUI/CEGUISchemeManager.h>
                                              22. #include <CEGUI/CEGUIWindowManager.h>
                                              23. #include <CEGUI/CEGUIWindow.h>
                                              24. #include <CEGUI/elements/CEGUICombobox.h>
                                              25. #include <CEGUI/elements/CEGUIComboDropList.h>
                                              26. #include <CEGUI/elements/CEGUIEditbox.h>
                                              27. #include <CEGUI/elements/CEGUIListbox.h>
                                              28. #include <CEGUI/elements/CEGUIListboxTextItem.h>
                                              29. #include <CEGUI/elements/CEGUIPushButton.h>
                                              30. #include <CEGUI/elements/CEGUIScrollbar.h>
                                              31. #include <CEGUI/elements/CEGUIRadioButton.h>
                                              32. #include "OgreCEGUIRenderer.h"
                                              33. #include "OgreCEGUIResourceProvider.h"
                                              34. #include "ExampleApplication.h"
                                              35. /*
                                              36. #include "OgreNoMemoryMacros.h"
                                              37. #include <ode/odecpp.h>
                                              38. #include <ode/odecpp_collision.h>
                                              39. #include "OgreMemoryMacros.h"
                                              40. */
                                              41. /*
                                              42. #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
                                              43. #include "OgreNoMemoryMacros.h"
                                              44. #include <crtdbg.h>
                                              45. #endi*/
                                              46. Entity* mAthene;
                                              47. AnimationState* mAnimState = 0;
                                              48. Entity* pPlaneEnt;
                                              49. std::vector<Entity*> pColumns;
                                              50. Light* mLight;
                                              51. Light* mSunLight;
                                              52. SceneNode* mLightNode = 0;
                                              53. AnimationState* mLightAnimationState = 0;
                                              54. ColourValue mMinLightColour(0.2, 0.1, 0.0);
                                              55. ColourValue mMaxLightColour(0.5, 0.3, 0.1);
                                              56. Real mMinFlareSize = 40;
                                              57. Real mMaxFlareSize = 80;
                                              58. // New depth shadowmapping
                                              59. String CUSTOM_ROCKWALL_MATERIAL("Ogre/DepthShadowmap/Receiver/RockWall");
                                              60. String CUSTOM_CASTER_MATERIAL("Ogre/DepthShadowmap/Caster/Float");
                                              61. String CUSTOM_RECEIVER_MATERIAL("Ogre/DepthShadowmap/Receiver/Float");
                                              62. String CUSTOM_ATHENE_MATERIAL("Ogre/DepthShadowmap/Receiver/Athene");
                                              63. String BASIC_ROCKWALL_MATERIAL("Examples/Rockwall");
                                              64. String BASIC_ATHENE_MATERIAL("Examples/Athene/NormalMapped");
                                              65. OverlayElement* mShadowTechniqueInfo;
                                              66. OverlayElement* mMaterialInfo;
                                              67. OverlayElement* mInfo;
                                              68. /** This class 'wibbles' the light and billboard */
                                              69. class LightWibbler : public ControllerValue<Real>
                                              70. {
                                              71. protected:
                                              72.     Light* mLight;
                                              73.     Billboard* mBillboard;
                                              74.     ColourValue mColourRange;
                                              75.     ColourValue mMinColour;
                                              76.     Real mMinSize;
                                              77.     Real mSizeRange;
                                              78.     Real intensity;
                                              79. public:
                                              80.     LightWibbler(Light* light, Billboard* billboard, const ColourValue& minColour,
                                              81.         const ColourValue& maxColour, Real minSize, Real maxSize)
                                              82.     {
                                              83.         mLight = light;
                                              84.         mBillboard = billboard;
                                              85.         mMinColour = minColour;
                                              86.         mColourRange.r = maxColour.r - minColour.r;
                                              87.         mColourRange.g = maxColour.g - minColour.g;
                                              88.         mColourRange.b = maxColour.b - minColour.b;
                                              89.         mMinSize = minSize;
                                              90.         mSizeRange = maxSize - minSize;
                                              91.     }
                                              92.     virtual Real  getValue (void) const
                                              93.     {
                                              94.         return intensity;
                                              95.     }
                                              96.     virtual void  setValue (Real value)
                                              97.     {
                                              98.         intensity = value;
                                              99.         ColourValue newColour;
                                              100.         // Attenuate the brightness of the light
                                              101.         newColour.r = mMinColour.r + (mColourRange.r * intensity);
                                              102.         newColour.g = mMinColour.g + (mColourRange.g * intensity);
                                              103.         newColour.b = mMinColour.b + (mColourRange.b * intensity);
                                              104.         mLight->setDiffuseColour(newColour);
                                              105.         mBillboard->setColour(newColour);
                                              106.         // set billboard size
                                              107.         Real newSize = mMinSize + (intensity * mSizeRange);
                                              108.         mBillboard->setDimensions(newSize, newSize);
                                              109.     }
                                              110. };
                                              111. Real timeDelay = 0;
                                              112. #define KEY_PRESSED(_key,_timeDelay, _macro) \
                                              113. { \
                                              114.     if (mKeyboard->isKeyDown(_key) && timeDelay <= 0) \
                                              115. { \
                                              116.     timeDelay = _timeDelay; \
                                              117.     _macro ; \
                                              118. } \
                                              119. }
                                              120. //---------------------------------------------------------------------------
                                              121. class GaussianListener: public Ogre::CompositorInstance::Listener
                                              122. {
                                              123. protected:
                                              124.         int mVpWidth, mVpHeight;
                                              125.         // Array params - have to pack in groups of 4 since this is how Cg generates them
                                              126.         // also prevents dependent texture read problems if ops don't require swizzle
                                              127.         float mBloomTexWeights[15][4];
                                              128.         float mBloomTexOffsetsHorz[15][4];
                                              129.         float mBloomTexOffsetsVert[15][4];
                                              130. public:
                                              131.         GaussianListener() {}
                                              132.         virtual ~GaussianListener() {}
                                              133.         void notifyViewportSize(int width, int height)
                                              134.         {
                                              135.                 mVpWidth = width;
                                              136.                 mVpHeight = height;
                                              137.                 // Calculate gaussian texture offsets & weights
                                              138.                 float deviation = 3.0f;
                                              139.                 float texelSize = 1.0f / (float)std::min(mVpWidth, mVpHeight);
                                              140.                 // central sample, no offset
                                              141.                 mBloomTexOffsetsHorz[0][0] = 0.0f;
                                              142.                 mBloomTexOffsetsHorz[0][1] = 0.0f;
                                              143.                 mBloomTexOffsetsVert[0][0] = 0.0f;
                                              144.                 mBloomTexOffsetsVert[0][1] = 0.0f;
                                              145.                 mBloomTexWeights[0][0] = mBloomTexWeights[0][1] =
                                              146.                         mBloomTexWeights[0][2] = Ogre::Math::gaussianDistribution(0, 0, deviation);
                                              147.                 mBloomTexWeights[0][3] = 1.0f;
                                              148.                 // 'pre' samples
                                              149.                 for(int i = 1; i < 8; ++i)
                                              150.                 {
                                              151.                         mBloomTexWeights[i][0] = mBloomTexWeights[i][1] =
                                              152.                                 mBloomTexWeights[i][2] = Ogre::Math::gaussianDistribution(i, 0, deviation);
                                              153.                         mBloomTexWeights[i][3] = 1.0f;
                                              154.                         mBloomTexOffsetsHorz[i][0] = i * texelSize;
                                              155.                         mBloomTexOffsetsHorz[i][1] = 0.0f;
                                              156.                         mBloomTexOffsetsVert[i][0] = 0.0f;
                                              157.                         mBloomTexOffsetsVert[i][1] = i * texelSize;
                                              158.                 }
                                              159.                 // 'post' samples
                                              160.                 for(int i = 8; i < 15; ++i)
                                              161.                 {
                                              162.                         mBloomTexWeights[i][0] = mBloomTexWeights[i][1] =
                                              163.                                 mBloomTexWeights[i][2] = mBloomTexWeights[i - 7][0];
                                              164.                         mBloomTexWeights[i][3] = 1.0f;
                                              165.                         mBloomTexOffsetsHorz[i][0] = -mBloomTexOffsetsHorz[i - 7][0];
                                              166.                         mBloomTexOffsetsHorz[i][1] = 0.0f;
                                              167.                         mBloomTexOffsetsVert[i][0] = 0.0f;
                                              168.                         mBloomTexOffsetsVert[i][1] = -mBloomTexOffsetsVert[i - 7][1];
                                              169.                 }
                                              170.         }
                                              171.         virtual void notifyMaterialSetup(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat)
                                              172.         {
                                              173.                 // Prepare the fragment params offsets
                                              174.                 switch(pass_id)
                                              175.                 {
                                              176.                 case 701: // blur horz
                                              177.                         {
                                              178.                                 // horizontal bloom
                                              179.                                 mat->load();
                                              180.                                 Ogre::GpuProgramParametersSharedPtr fparams =
                                              181.                                         mat->getBestTechnique()->getPass(0)->getFragmentProgramParameters();
                                              182.                                 const Ogre::String& progName = mat->getBestTechnique()->getPass(0)->getFragmentProgramName();
                                              183.                                 // A bit hacky - Cg & HLSL index arrays via [0], GLSL does not
                                              184.                                 fparams->setNamedConstant("sampleOffsets", mBloomTexOffsetsHorz[0], 15);
                                              185.                                 fparams->setNamedConstant("sampleWeights", mBloomTexWeights[0], 15);
                                              186.                                 break;
                                              187.                         }
                                              188.                 case 700: // blur vert
                                              189.                         {
                                              190.                                 // vertical bloom
                                              191.                                 mat->load();
                                              192.                                 Ogre::GpuProgramParametersSharedPtr fparams =
                                              193.                                         mat->getTechnique(0)->getPass(0)->getFragmentProgramParameters();
                                              194.                                 const Ogre::String& progName = mat->getBestTechnique()->getPass(0)->getFragmentProgramName();
                                              195.                                 fparams->setNamedConstant("sampleOffsets", mBloomTexOffsetsVert[0], 15);
                                              196.                                 fparams->setNamedConstant("sampleWeights", mBloomTexWeights[0], 15);
                                              197.                                 break;
                                              198.                         }
                                              199.                 }
                                              200.         }
                                              201.         virtual void notifyMaterialRender(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat)
                                              202.         {
                                              203.         }
                                              204. };
                                              205. GaussianListener gaussianListener;
                                              206. class ShadowsListener : public ExampleFrameListener, public OIS::MouseListener,
                                              207.         public OIS::KeyListener
                                              208. {
                                              209. protected:
                                              210.     SceneManager* mSceneMgr;
                                              211.         Viewport *mShadowVp;
                                              212.         CompositorInstance* mShadowCompositor;
                                              213.         bool mShutdownRequested;
                                              214.         CEGUI::Window* mRootGuiPanel;
                                              215.         bool mLMBDown;
                                              216.         bool mRMBDown;
                                              217.         bool mProcessMovement;
                                              218.         bool mUpdateMovement;
                                              219.         bool mMoveFwd;
                                              220.         bool mMoveBck;
                                              221.         bool mMoveLeft;
                                              222.         bool mMoveRight;
                                              223.         CEGUI::Point mLastMousePosition;
                                              224.         bool mLastMousePositionSet;
                                              225.         float mAvgFrameTime;
                                              226.         Camera* mTexCam;
                                              227.         //----------------------------------------------------------------//
                                              228.         CEGUI::MouseButton convertOISMouseButtonToCegui(int buttonID)
                                              229.         {
                                              230.                 switch (buttonID)
                                              231.                 {
                                              232.                 case 0: return CEGUI::LeftButton;
                                              233.                 case 1: return CEGUI::RightButton;
                                              234.                 case 2return CEGUI::MiddleButton;
                                              235.                 case 3: return CEGUI::X1Button;
                                              236.                 default: return CEGUI::LeftButton;
                                              237.                 }
                                              238.         }
                                              239. public:
                                              240.         ShadowsListener(RenderWindow* win, Camera* cam, SceneManager* sm)
                                              241.         : ExampleFrameListener(win, cam, true, true)
                                              242.                 , mSceneMgr(sm)
                                              243.                 , mShadowVp(0)
                                              244.                 , mShadowCompositor(0)
                                              245.                 , mShutdownRequested(false)
                                              246.                 , mLMBDown(false)
                                              247.                 , mRMBDown(false)
                                              248.                 , mProcessMovement(false)
                                              249.                 , mUpdateMovement(false)
                                              250.                 , mMoveFwd(false)
                                              251.                 , mMoveBck(false)
                                              252.                 , mMoveLeft(false)
                                              253.                 , mMoveRight(false)
                                              254.                 , mLastMousePositionSet(false)
                                              255.                 , mAvgFrameTime(0.1f)
                                              256.     {
                                              257.                 mMouse->setEventCallback(this);
                                              258.                 mKeyboard->setEventCallback(this);
                                              259.                 mRootGuiPanel = CEGUI::WindowManager::getSingleton().getWindow("Shadows");
                                              260.                 mMoveSpeed = 10.0f;
                                              261.                 // Set up a debug panel to display the shadow
                                              262.                 MaterialPtr debugMat = MaterialManager::getSingleton().create(
                                              263.                         "Ogre/DebugShadowMap0", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
                                              264.                 debugMat->getTechnique(0)->getPass(0)->setLightingEnabled(false);
                                              265.                 TexturePtr shadowTex = mSceneMgr->getShadowTexture(0);
                                              266.                 TextureUnitState *t = debugMat->getTechnique(0)->getPass(0)->createTextureUnitState(shadowTex->getName());
                                              267.                 t->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
                                              268.                 debugMat = MaterialManager::getSingleton().create(
                                              269.                         "Ogre/DebugShadowMap1", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
                                              270.                 debugMat->getTechnique(0)->getPass(0)->setLightingEnabled(false);
                                              271.                 shadowTex = mSceneMgr->getShadowTexture(1);
                                              272.                 t = debugMat->getTechnique(0)->getPass(0)->createTextureUnitState(shadowTex->getName());
                                              273.                 t->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
                                              274.                 /* Uncomment this to display the shadow textures
                                              275.                 OverlayContainer* debugPanel = (OverlayContainer*)
                                              276.                         (OverlayManager::getSingleton().createOverlayElement("Panel", "Ogre/DebugShadowPanel0"));
                                              277.                 debugPanel->_setPosition(0.8, 0);
                                              278.                 debugPanel->_setDimensions(0.2, 0.2);
                                              279.                 debugPanel->setMaterialName("Ogre/DebugShadowMap0");
                                              280.                 Overlay* debugOverlay = OverlayManager::getSingleton().getByName("Core/DebugOverlay");
                                              281.                 debugOverlay->add2D(debugPanel);
                                              282.                 debugPanel = (OverlayContainer*)
                                              283.                         (OverlayManager::getSingleton().createOverlayElement("Panel", "Ogre/DebugShadowPanel1"));
                                              284.                 debugPanel->_setPosition(0.8, 0.2);
                                              285.                 debugPanel->_setDimensions(0.2, 0.2);
                                              286.                 debugPanel->setMaterialName("Ogre/DebugShadowMap1");
                                              287.                 debugOverlay->add2D(debugPanel);
                                              288.                 */
                                              289.     }
                                              290.         bool frameStarted(const FrameEvent& evt)
                                              291.         {
                                              292.                 CEGUI::System::getSingleton().injectTimePulse(evt.timeSinceLastFrame);
                                              293.                 mMouse->capture();
                                              294.                 mKeyboard->capture();
                                              295.                 if (mShutdownRequested)
                                              296.                         return false;
                                              297.                 else
                                              298.                 {
                                              299.                         // update movement process
                                              300.                         if(mProcessMovement || mUpdateMovement)
                                              301.                         {
                                              302.                                 mTranslateVector.x += mMoveLeft ? mAvgFrameTime * -mMoveSpeed : 0;
                                              303.                                 mTranslateVector.x += mMoveRight ? mAvgFrameTime * mMoveSpeed : 0;
                                              304.                                 mTranslateVector.z += mMoveFwd ? mAvgFrameTime * -mMoveSpeed : 0;
                                              305.                                 mTranslateVector.z += mMoveBck ? mAvgFrameTime * mMoveSpeed : 0;
                                              306.                                 mCamera->yaw(mRotX);
                                              307.                                 mCamera->pitch(mRotY);
                                              308.                                 mCamera->moveRelative(mTranslateVector);
                                              309.                                 mUpdateMovement = false;
                                              310.                                 mRotX = 0;
                                              311.                                 mRotY = 0;
                                              312.                                 mTranslateVector = Ogre::Vector3::ZERO;
                                              313.                         }
                                              314.                 }
                                              315.                 return true;
                                              316.         }
                                              317.     bool frameEnded(const FrameEvent& evt)
                                              318.     {
                                              319.                 if (mAnimState)
                                              320.                         mAnimState->addTime(evt.timeSinceLastFrame);
                                              321.                 if (mShutdownRequested)
                                              322.                         return false;
                                              323.                 else
                                              324.                         return ExampleFrameListener::frameEnded(evt);
                                              325.     }
                                              326.         //----------------------------------------------------------------//
                                              327.         bool mouseMoved( const OIS::MouseEvent &arg )
                                              328.         {
                                              329.                 CEGUI::System::getSingleton().injectMouseMove( arg.state.X.rel, arg.state.Y.rel );
                                              330.                 return true;
                                              331.         }
                                              332.         //----------------------------------------------------------------//
                                              333.         bool mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
                                              334.         {
                                              335.                 CEGUI::System::getSingleton().injectMouseButtonDown(convertOISMouseButtonToCegui(id));
                                              336.                 return true;
                                              337.         }
                                              338.         //----------------------------------------------------------------//
                                              339.         bool mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
                                              340.         {
                                              341.                 CEGUI::System::getSingleton().injectMouseButtonUp(convertOISMouseButtonToCegui(id));
                                              342.                 return true;
                                              343.         }
                                              344.         //----------------------------------------------------------------//
                                              345.         bool keyPressed( const OIS::KeyEvent &arg )
                                              346.         {
                                              347.                 if( arg.key == OIS::KC_ESCAPE )
                                              348.                         mShutdownRequested = true;
                                              349.                 if (arg.key == OIS::KC_SYSRQ)
                                              350.                         mWindow->writeContentsToTimestampedFile("screenshot", ".jpg");
                                              351.                 CEGUI::System::getSingleton().injectKeyDown( arg.key );
                                              352.                 CEGUI::System::getSingleton().injectChar( arg.text );
                                              353.                 return true;
                                              354.         }
                                              355.         //----------------------------------------------------------------//
                                              356.         bool keyReleased( const OIS::KeyEvent &arg )
                                              357.         {
                                              358.                 CEGUI::System::getSingleton().injectKeyUp( arg.key );
                                              359.                 return true;
                                              360.         }
                                              361.         //--------------------------------------------------------------------------
                                              362.         bool handleMouseMove(const CEGUI::EventArgs& e)
                                              363.         {
                                              364.                 const CEGUI::MouseEventArgs& me = static_cast<const CEGUI::MouseEventArgs&>(e);
                                              365.                 if( mLMBDown && !mRMBDown)
                                              366.                 {
                                              367.                         // rotate camera
                                              368.                         mRotX += Degree(-me.moveDelta.d_x * mAvgFrameTime * 3.0);
                                              369.                         mRotY += Degree(-me.moveDelta.d_y * mAvgFrameTime * 3.0);
                                              370.                         CEGUI::MouseCursor::getSingleton().setPosition( mLastMousePosition );
                                              371.                         mUpdateMovement = true;
                                              372.                 }
                                              373.                 else
                                              374.                 {
                                              375.                         if( mRMBDown && !mLMBDown)
                                              376.                         {
                                              377.                                 // translate camera
                                              378.                                 mTranslateVector.x += me.moveDelta.d_x * mAvgFrameTime * mMoveSpeed;
                                              379.                                 mTranslateVector.y += -me.moveDelta.d_y * mAvgFrameTime * mMoveSpeed;
                                              380.                                 //mTranslateVector.z = 0;
                                              381.                                 CEGUI::MouseCursor::getSingleton().setPosition( mLastMousePosition );
                                              382.                                 mUpdateMovement = true;
                                              383.                         }
                                              384.                         else
                                              385.                         {
                                              386.                                 if( mRMBDown && mLMBDown)
                                              387.                                 {
                                              388.                                         mTranslateVector.z += (me.moveDelta.d_x + me.moveDelta.d_y) * mAvgFrameTime * mMoveSpeed;
                                              389.                                         CEGUI::MouseCursor::getSingleton().setPosition( mLastMousePosition );
                                              390.                                         mUpdateMovement = true;
                                              391.                                 }
                                              392.                         }
                                              393.                 }
                                              394.                 return true;
                                              395.         }
                                              396.         //--------------------------------------------------------------------------
                                              397.         bool handleMouseButtonUp(const CEGUI::EventArgs& e)
                                              398.         {
                                              399.                 const CEGUI::MouseEventArgs& me = static_cast<const CEGUI::MouseEventArgs&>(e);
                                              400.                 //Window* wndw = ((const WindowEventArgs&)e).window;
                                              401.                 if( me.button == CEGUI::LeftButton )
                                              402.                 {
                                              403.                         mLMBDown = false;
                                              404.                 }
                                              405.                 if( me.button == CEGUI::RightButton )
                                              406.                 {
                                              407.                         mRMBDown = false;
                                              408.                 }
                                              409.                 if( !mLMBDown && !mRMBDown )
                                              410.                 {
                                              411.                         CEGUI::MouseCursor::getSingleton().show();
                                              412.                         if(mLastMousePositionSet)
                                              413.                         {
                                              414.                                 CEGUI::MouseCursor::getSingleton().setPosition( mLastMousePosition );
                                              415.                                 mLastMousePositionSet = false;
                                              416.                         }
                                              417.                         mRootGuiPanel->releaseInput();
                                              418.                 }
                                              419.                 return true;
                                              420.         }
                                              421.         //--------------------------------------------------------------------------
                                              422.         bool handleMouseButtonDown(const CEGUI::EventArgs& e)
                                              423.         {
                                              424.                 const CEGUI::MouseEventArgs& me = static_cast<const CEGUI::MouseEventArgs&>(e);
                                              425.                 //Window* wndw = ((const WindowEventArgs&)e).window;
                                              426.                 if( me.button == CEGUI::LeftButton )
                                              427.                 {
                                              428.                         mLMBDown = true;
                                              429.                 }
                                              430.                 if( me.button == CEGUI::RightButton )
                                              431.                 {
                                              432.                         mRMBDown = true;
                                              433.                 }
                                              434.                 if( mLMBDown || mRMBDown )
                                              435.                 {
                                              436.                         CEGUI::MouseCursor::getSingleton().hide();
                                              437.                         if (!mLastMousePositionSet)
                                              438.                         {
                                              439.                                 mLastMousePosition = CEGUI::MouseCursor::getSingleton().getPosition();
                                              440.                                 mLastMousePositionSet = true;
                                              441.                         }
                                              442.                         mRootGuiPanel->captureInput();
                                              443.                 }
                                              444.                 return true;
                                              445.         }
                                              446.         //--------------------------------------------------------------------------
                                              447.         bool handleMouseWheelEvent(const CEGUI::EventArgs& e)
                                              448.         {
                                              449.                 const CEGUI::MouseEventArgs& me = static_cast<const CEGUI::MouseEventArgs&>(e);
                                              450.                 mTranslateVector.z += me.wheelChange * -5.0;
                                              451.                 mUpdateMovement = true;
                                              452.                 return true;
                                              453.         }
                                              454.         //--------------------------------------------------------------------------
                                              455.         void checkMovementKeys(CEGUI::Key::Scan scancode, bool state )
                                              456.         {
                                              457.                 switch ( scancode )
                                              458.                 {
                                              459.                 case CEGUI::Key::A:
                                              460.                         mMoveLeft = state;
                                              461.                         break;
                                              462.                 case CEGUI::Key::D:
                                              463.                         mMoveRight = state;
                                              464.                         break;
                                              465.                 case CEGUI::Key::S:
                                              466.                         mMoveBck = state;
                                              467.                         break;
                                              468.                 case CEGUI::Key::W:
                                              469.                         mMoveFwd = state;
                                              470.                         break;
                                              471.                 default:
                                              472.                         break;
                                              473.                 }
                                              474.                 mProcessMovement = mMoveLeft || mMoveRight || mMoveFwd || mMoveBck;
                                              475.         }
                                              476.         //--------------------------------------------------------------------------
                                              477.         bool handleKeyDownEvent(const CEGUI::EventArgs& e)
                                              478.         {
                                              479.                 const CEGUI::KeyEventArgs& ke = static_cast<const CEGUI::KeyEventArgs&>(e);
                                              480.                 checkMovementKeys(ke.scancode , true);
                                              481.                 return true;
                                              482.         }
                                              483.         //--------------------------------------------------------------------------
                                              484.         bool handleKeyUpEvent(const CEGUI::EventArgs& e)
                                              485.         {
                                              486.                 const CEGUI::KeyEventArgs& ke = static_cast<const CEGUI::KeyEventArgs&>(e);
                                              487.                 checkMovementKeys(ke.scancode, false );
                                              488.                 return true;
                                              489.         }
                                              490. };
                                              491. class ShadowsApplication : public ExampleApplication
                                              492. {
                                              493. protected:
                                              494.         enum ShadowProjection
                                              495.         {
                                              496.                 UNIFORM,
                                              497.                 UNIFORM_FOCUSED,
                                              498.                 LISPSM,
                                              499.                 PLANE_OPTIMAL
                                              500.         };
                                              501.         enum ShadowMaterial
                                              502.         {
                                              503.                 MAT_STANDARD,
                                              504.                 MAT_DEPTH_FLOAT,
                                              505.                 MAT_DEPTH_FLOAT_PCF
                                              506.         };
                                              507.         CEGUI::OgreCEGUIRenderer* mGUIRenderer;
                                              508.         CEGUI::System* mGUISystem;
                                              509.         CEGUI::Window* mDescWindow;
                                              510.         CEGUI::Scrollbar* mFixedBias;
                                              511.         CEGUI::Scrollbar* mGradientBias;
                                              512.         CEGUI::Scrollbar* mGradientClamp;
                                              513.         CEGUI::Window* mDepthShadowTweak;
                                              514.         CEGUI::Window* mFixedBiasText;
                                              515.         CEGUI::Window* mGradientBiasText;
                                              516.         CEGUI::Window* mGradientClampText;
                                              517.         ShadowTechnique mCurrentShadowTechnique;
                                              518.         ShadowProjection mCurrentProjection;
                                              519.         ShadowMaterial mCurrentMaterial;
                                              520.         GpuProgramParametersSharedPtr mCustomRockwallVparams;
                                              521.         GpuProgramParametersSharedPtr mCustomRockwallFparams;
                                              522.         GpuProgramParametersSharedPtr mCustomAtheneVparams;
                                              523.         GpuProgramParametersSharedPtr mCustomAtheneFparams;
                                              524.         ShadowCameraSetupPtr mCurrentShadowCameraSetup;
                                              525.         /// Plane that defines plane-optimal shadow mapping basis
                                              526.         MovablePlane* mPlane;
                                              527.         // transient pointer to LiSPSM setup if present
                                              528.         LiSPSMShadowCameraSetup* mLiSPSMSetup;
                                              529.         bool mIsOpenGL;
                                              530. public:
                                              531.         ShadowsApplication() :
                                              532.           mGUIRenderer(0),
                                              533.           mGUISystem(0),
                                              534.           mPlane(0)
                                              535.         {
                                              536.     }
                                              537.     ~ShadowsApplication()
                                              538.     {
                                              539.                 mDescWindow = 0;
                                              540.                 if(mGUISystem)
                                              541.                 {
                                              542.                         delete mGUISystem;
                                              543.                         mGUISystem = 0;
                                              544.                 }
                                              545.                 if(mGUIRenderer)
                                              546.                 {
                                              547.                         delete mGUIRenderer;
                                              548.                         mGUIRenderer = 0;
                                              549.                 }
                                              550.                 delete mPlane;
                                              551.     }
                                              552. protected:
                                              553.         // Override this to ensure FPU mode
                                              554.         bool configure(void)
                                              555.         {
                                              556.                 // Show the configuration dialog and initialise the system
                                              557.                 // You can skip this and use root.restoreConfig() to load configuration
                                              558.                 // settings if you were sure there are valid ones saved in ogre.cfg
                                              559.                 if(mRoot->showConfigDialog())
                                              560.                 {
                                              561.                         // Custom option - to use PlaneOptimalShadowCameraSetup we must have
                                              562.                         // double-precision. Thus, set the D3D floating point mode if present,
                                              563.                         // no matter what was chosen
                                              564.                         ConfigOptionMap& optMap = mRoot->getRenderSystem()->getConfigOptions();
                                              565.                         ConfigOptionMap::iterator i = optMap.find("Floating-point mode");
                                              566.                         if (i != optMap.end())
                                              567.                         {
                                              568.                                 if (i->second.currentValue != "Consistent")
                                              569.                                 {
                                              570.                                         i->second.currentValue = "Consistent";
                                              571.                                         LogManager::getSingleton().logMessage("Demo_Shadows: overriding "
                                              572.                                                 "D3D floating point mode to 'Consistent' to ensure precision "
                                              573.                                                 "for plane-optimal camera setup option");
                                              574.                                 }
                                              575.                         }
                                              576.                         // If returned true, user clicked OK so initialise
                                              577.                         // Here we choose to let the system create a default rendering window by passing 'true'
                                              578.                         mWindow = mRoot->initialise(true);
                                              579.                         return true;
                                              580.                 }
                                              581.                 else
                                              582.                 {
                                              583.                         return false;
                                              584.                 }
                                              585.         }
                                              586.         void generalSceneSetup()
                                              587.     {
                                              588.         // do this first so we generate edge lists
                                              589.         mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_ADDITIVE);
                                              590.                 mCurrentShadowTechnique = SHADOWTYPE_STENCIL_ADDITIVE;
                                              591.         // Set ambient light off
                                              592.         mSceneMgr->setAmbientLight(ColourValue(0.0, 0.0, 0.0));
                                              593.         // Fixed light, dim
                                              594.         mSunLight = mSceneMgr->createLight("SunLight");
                                              595.         mSunLight->setType(Light::LT_SPOTLIGHT);
                                              596.         mSunLight->setPosition(1500,1750,1300);
                                              597.         mSunLight->setSpotlightRange(Degree(30), Degree(50));
                                              598.         Vector3 dir;
                                              599.         dir = -mSunLight->getPosition();
                                              600.         dir.normalise();
                                              601.         mSunLight->setDirection(dir);
                                              602.         mSunLight->setDiffuseColour(0.35, 0.35, 0.38);
                                              603.         mSunLight->setSpecularColour(0.9, 0.9, 1);
                                              604.         // Point light, movable, reddish
                                              605.         mLight = mSceneMgr->createLight("Light2");
                                              606.         mLight->setDiffuseColour(mMinLightColour);
                                              607.         mLight->setSpecularColour(1, 1, 1);
                                              608.         mLight->setAttenuation(8000,1,0.0005,0);
                                              609.         // Create light node
                                              610.         mLightNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(
                                              611.             "MovingLightNode");
                                              612.         mLightNode->attachObject(mLight);
                                              613.         // create billboard set
                                              614.         BillboardSet* bbs = mSceneMgr->createBillboardSet("lightbbs", 1);
                                              615.         bbs->setMaterialName("Examples/Flare");
                                              616.         Billboard* bb = bbs->createBillboard(0,0,0,mMinLightColour);
                                              617.         // attach
                                              618.         mLightNode->attachObject(bbs);
                                              619.         // create controller, after this is will get updated on its own
                                              620.         ControllerFunctionRealPtr func = ControllerFunctionRealPtr(
                                              621.             new WaveformControllerFunction(Ogre::WFT_SINE, 0.75, 0.5));
                                              622.         ControllerManager& contMgr = ControllerManager::getSingleton();
                                              623.         ControllerValueRealPtr val = ControllerValueRealPtr(
                                              624.             new LightWibbler(mLight, bb, mMinLightColour, mMaxLightColour,
                                              625.             mMinFlareSize, mMaxFlareSize));
                                              626.         Controller<Real>* controller = contMgr.createController(
                                              627.             contMgr.getFrameTimeSource(), val, func);
                                              628.         //mLight->setPosition(Vector3(300,250,-300));
                                              629.         mLightNode->setPosition(Vector3(300,1750,-700));
                                              630.         // Create a track for the light
                                              631.         Animation* anim = mSceneMgr->createAnimation("LightTrack", 20);
                                              632.         // Spline it for nice curves
                                              633.         anim->setInterpolationMode(Animation::IM_SPLINE);
                                              634.         // Create a track to animate the camera's node
                                              635.         NodeAnimationTrack* track = anim->createNodeTrack(0, mLightNode);
                                              636.         // Setup keyframes
                                              637.         TransformKeyFrame* key = track->createNodeKeyFrame(0); // A startposition
                                              638.         key->setTranslate(Vector3(300,750,-700));
                                              639.         key = track->createNodeKeyFrame(2);//B
                                              640.         key->setTranslate(Vector3(150,800,-250));
                                              641.         key = track->createNodeKeyFrame(4);//C
                                              642.         key->setTranslate(Vector3(-150,850,-100));
                                              643.         key = track->createNodeKeyFrame(6);//D
                                              644.         key->setTranslate(Vector3(-400,700,-200));
                                              645.         key = track->createNodeKeyFrame(8);//E
                                              646.         key->setTranslate(Vector3(-200,700,-400));
                                              647.         key = track->createNodeKeyFrame(10);//F
                                              648.         key->setTranslate(Vector3(-100,850,-200));
                                              649.         key = track->createNodeKeyFrame(12);//G
                                              650.         key->setTranslate(Vector3(-100,575,180));
                                              651.         key = track->createNodeKeyFrame(14);//H
                                              652.         key->setTranslate(Vector3(0,750,300));
                                              653.         key = track->createNodeKeyFrame(16);//I
                                              654.         key->setTranslate(Vector3(100,850,100));
                                              655.         key = track->createNodeKeyFrame(18);//J
                                              656.         key->setTranslate(Vector3(250,800,0));
                                              657.         key = track->createNodeKeyFrame(20);//K == A
                                              658.         key->setTranslate(Vector3(300,750,-700));
                                              659.         // Create a new animation state to track this
                                              660.         mAnimState = mSceneMgr->createAnimationState("LightTrack");
                                              661.         mAnimState->setEnabled(true);
                                              662.         // Make light node look at origin, this is for when we
                                              663.         // change the moving light to a spotlight
                                              664.         mLightNode->setAutoTracking(true, mSceneMgr->getRootSceneNode());
                                              665.         // Prepare athene mesh for normalmapping
                                              666.         MeshPtr pAthene = MeshManager::getSingleton().load("athene.mesh",
                                              667.             ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
                                              668.         unsigned short src, dest;
                                              669.         if (!pAthene->suggestTangentVectorBuildParams(VES_TANGENT, src, dest))
                                              670.         {
                                              671.             pAthene->buildTangentVectors(VES_TANGENT, src, dest);
                                              672.         }
                                              673.         SceneNode* node;
                                              674.         node = mSceneMgr->getRootSceneNode()->createChildSceneNode();
                                              675.         mAthene = mSceneMgr->createEntity( "athene", "athene.mesh" );
                                              676.         mAthene->setMaterialName(BASIC_ATHENE_MATERIAL);
                                              677.         node->attachObject( mAthene );
                                              678.         node->translate(0,-27, 0);
                                              679.         node->yaw(Degree(90));
                                              680.         Entity* pEnt;
                                              681.                 // Columns
                                              682.                 for (int x = -2; x <= 2; ++x)
                                              683.                 {
                                              684.                         for (int z = -2; z <= 2; ++z)
                                              685.                         {
                                              686.                                 if (x != 0 || z != 0)
                                              687.                                 {
                                              688.                                         StringUtil::StrStreamType str;
                                              689.                                         str << "col" << x << "_" << z;
                                              690.                                         node = mSceneMgr->getRootSceneNode()->createChildSceneNode();
                                              691.                                         pEnt = mSceneMgr->createEntity( str.str(), "column.mesh" );
                                              692.                                         pEnt->setMaterialName(BASIC_ROCKWALL_MATERIAL);
                                              693.                                         pColumns.push_back(pEnt);
                                              694.                                         node->attachObject( pEnt );
                                              695.                                         node->translate(x*300,0, z*300);
                                              696.                                 }
                                              697.                         }
                                              698.                 }
                                              699.         // Skybox
                                              700.         mSceneMgr->setSkyBox(true, "Examples/StormySkyBox");
                                              701.         // Floor plane (use POSM plane def)
                                              702.                 mPlane = new MovablePlane("*mPlane");
                                              703.         mPlane->normal = Vector3::UNIT_Y;
                                              704.         mPlane->d = 107;
                                              705.         MeshManager::getSingleton().createPlane("Myplane",
                                              706.             ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, *mPlane,
                                              707.             1500,1500,50,50,true,1,5,5,Vector3::UNIT_Z);
                                              708.         pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
                                              709.         pPlaneEnt->setMaterialName(BASIC_ROCKWALL_MATERIAL);
                                              710.         pPlaneEnt->setCastShadows(false);
                                              711.         mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
                                              712.                 if (mRoot->getRenderSystem()->getCapabilities()->hasCapability(RSC_HWRENDER_TO_TEXTURE))
                                              713.         {
                                              714.             // In D3D, use a 1024x1024 shadow texture
                                              715.             mSceneMgr->setShadowTextureSettings(1024, 2);
                                              716.         }
                                              717.         else
                                              718.         {
                                              719.             // Use 512x512 texture in GL since we can't go higher than the window res
                                              720.             mSceneMgr->setShadowTextureSettings(512, 2);
                                              721.         }
                                              722.         mSceneMgr->setShadowColour(ColourValue(0.5, 0.5, 0.5));
                                              723.         // incase infinite far distance is not supported
                                              724.         mCamera->setFarClipDistance(100000);
                                              725.         //mSceneMgr->setShowDebugShadows(true);
                                              726.                 mCamera->setPosition(250, 20, 400);
                                              727.                 mCamera->lookAt(0, 10, 0);
                                              728.     }
                                              729.     // Just override the mandatory create scene method
                                              730.     void createScene(void)
                                              731.     {
                                              732.                 // Need to detect D3D or GL for best depth shadowmapping
                                              733.                 if (Root::getSingleton().getRenderSystem()->getName().find("GL") != String::npos)
                                              734.                 {
                                              735.                         mIsOpenGL = true;
                                              736.                 }
                                              737.                 else
                                              738.                 {
                                              739.                         mIsOpenGL = false;
                                              740.                 }
                                              741.                 // set up general scene (this defaults to additive stencils)
                                              742.         generalSceneSetup();
                                              743.                 setupGUI();
                                              744.     }
                                              745.         /// Change basic shadow technique
                                              746.         void changeShadowTechnique(ShadowTechnique newTech)
                                              747.         {
                                              748.                 mSceneMgr->setShadowTechnique(newTech);
                                              749.                 // Below is for projection
                                              750.                 //configureShadowCameras(mCurrentShadowTechnique, newTech);
                                              751.                 configureLights(newTech);
                                              752.                 // Advanced modes - materials / compositors
                                              753.                 //configureCompositors(mCurrentShadowTechnique, newTech);
                                              754.                 //configureTextures(mCurrentShadowTechnique, newTech);
                                              755.                 //configureShadowCasterReceiverMaterials(mCurrentShadowTechnique, newTech);
                                              756.                 updateGUI(newTech);
                                              757.                 mCurrentShadowTechnique = newTech;
                                              758.         }
                                              759.         void configureLights(ShadowTechnique newTech)
                                              760.         {
                                              761.                 Vector3 dir;
                                              762.                 switch (newTech)
                                              763.                 {
                                              764.                 case SHADOWTYPE_STENCIL_ADDITIVE:
                                              765.                         // Fixed light, dim
                                              766.                         mSunLight->setCastShadows(true);
                                              767.                         // Point light, movable, reddish
                                              768.                         mLight->setType(Light::LT_POINT);
                                              769.                         mLight->setCastShadows(true);
                                              770.                         mLight->setDiffuseColour(mMinLightColour);
                                              771.                         mLight->setSpecularColour(1, 1, 1);
                                              772.                         mLight->setAttenuation(8000,1,0.0005,0);
                                              773.                         break;
                                              774.                 case SHADOWTYPE_STENCIL_MODULATIVE:
                                              775.                         // Multiple lights cause obvious silhouette edges in modulative mode
                                              776.                         // So turn off shadows on the direct light
                                              777.                         // Fixed light, dim
                                              778.                         mSunLight->setCastShadows(false);
                                              779.                         // Point light, movable, reddish
                                              780.                         mLight->setType(Light::LT_POINT);
                                              781.                         mLight->setCastShadows(true);
                                              782.                         mLight->setDiffuseColour(mMinLightColour);
                                              783.                         mLight->setSpecularColour(1, 1, 1);
                                              784.                         mLight->setAttenuation(8000,1,0.0005,0);
                                              785.                         break;
                                              786.                 case SHADOWTYPE_TEXTURE_MODULATIVE:
                                              787.                 case SHADOWTYPE_TEXTURE_ADDITIVE:
                                              788.                         // Fixed light, dim
                                              789.                         mSunLight->setCastShadows(true);
                                              790.                         // Change moving light to spotlight
                                              791.                         // Point light, movable, reddish
                                              792.                         mLight->setType(Light::LT_SPOTLIGHT);
                                              793.                         mLight->setDirection(Vector3::NEGATIVE_UNIT_Z);
                                              794.                         mLight->setCastShadows(true);
                                              795.                         mLight->setDiffuseColour(mMinLightColour);
                                              796.                         mLight->setSpecularColour(1, 1, 1);
                                              797.                         mLight->setAttenuation(8000,1,0.0005,0);
                                              798.                         mLight->setSpotlightRange(Degree(80),Degree(90));
                                              799.                         break;
                                              800.                 default:
                                              801.                         break;
                                              802.                 };
                                              803.         }
                                              804.         void setupGUI()
                                              805.         {
                                              806.                 // setup GUI system
                                              807.                 mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow,
                                              808.                         Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneMgr);
                                              809.                 mGUISystem = new CEGUI::System(mGUIRenderer);
                                              810.                 CEGUI::Logger::getSingleton().setLoggingLevel(CEGUI::Informative);
                                              811.                 // load scheme and set up defaults
                                              812.                 CEGUI::SchemeManager::getSingleton().loadScheme(
                                              813.                         (CEGUI::utf8*)"TaharezLookSkin.scheme");
                                              814.                 mGUISystem->setDefaultMouseCursor(
                                              815.                         (CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseArrow");
                                              816.                 mGUISystem->setDefaultFont((CEGUI::utf8*)"BlueHighway-12");
                                              817.                 CEGUI::Window* sheet =
                                              818.                         CEGUI::WindowManager::getSingleton().loadWindowLayout(
                                              819.                         (CEGUI::utf8*)"shadows.layout");
                                              820.                 mGUISystem->setGUISheet(sheet);
                                              821.                 // Tooltips aren't big enough, do our own
                                              822.                 //mGUISystem->setDefaultTooltip("TaharezLook/Tooltip");
                                              823.                 CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
                                              824.                 // Get description window
                                              825.                 mDescWindow = wmgr.getWindow("Shadows/Desc");
                                              826.                 CEGUI::Window *wnd = wmgr.getWindow("Shadows/Stencil");
                                              827.                 wnd->subscribeEvent(CEGUI::Window::EventMouseEnters,
                                              828.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnter, this));
                                              829.                 wnd->subscribeEvent(CEGUI::Window::EventMouseLeaves,
                                              830.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
                                              831.                 wnd = wmgr.getWindow("Shadows/Texture");
                                              832.                 wnd->subscribeEvent(CEGUI::Window::EventMouseEnters,
                                              833.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnter, this));
                                              834.                 wnd->subscribeEvent(CEGUI::Window::EventMouseLeaves,
                                              835.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
                                              836.                 wnd = wmgr.getWindow("Shadows/Additive");
                                              837.                 wnd->subscribeEvent(CEGUI::Window::EventMouseEnters,
                                              838.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnter, this));
                                              839.                 wnd->subscribeEvent(CEGUI::Window::EventMouseLeaves,
                                              840.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
                                              841.                 wnd = wmgr.getWindow("Shadows/Modulative");
                                              842.                 wnd->subscribeEvent(CEGUI::Window::EventMouseEnters,
                                              843.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnter, this));
                                              844.                 wnd->subscribeEvent(CEGUI::Window::EventMouseLeaves,
                                              845.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
                                              846.                 // Combo doesn't raise enter / exit itself, have to grab subcomponents?
                                              847.                 CEGUI::Combobox* cbo = static_cast<CEGUI::Combobox*>(wmgr.getWindow("Shadows/Projection"));
                                              848.                 cbo->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted,
                                              849.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleProjectionChanged, this));
                                              850.                 cbo->getEditbox()->subscribeEvent(CEGUI::Window::EventMouseEnters,
                                              851.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnterCombo, this));
                                              852.                 cbo->getEditbox()->subscribeEvent(CEGUI::Window::EventMouseLeaves,
                                              853.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
                                              854.                 cbo->getDropList()->subscribeEvent(CEGUI::Window::EventMouseEnters,
                                              855.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnterCombo, this));
                                              856.                 cbo->getDropList()->subscribeEvent(CEGUI::Window::EventMouseLeaves,
                                              857.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
                                              858.                 cbo->getPushButton()->subscribeEvent(CEGUI::Window::EventMouseEnters,
                                              859.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnterCombo, this));
                                              860.                 cbo->getPushButton()->subscribeEvent(CEGUI::Window::EventMouseLeaves,
                                              861.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
                                              862.                 // Populate projection
                                              863.                 // Get a select image to be used for highlighting items in listbox when mouse moves over them
                                              864.                 const CEGUI::Image* selectImage = &CEGUI::ImagesetManager::getSingleton().getImageset("TaharezLook")->getImage("MultiListSelectionBrush");
                                              865.                 CEGUI::ListboxTextItem* li = new CEGUI::ListboxTextItem("Uniform", UNIFORM);
                                              866.         li->setSelectionBrushImage(selectImage);
                                              867.                 li->setTooltipText("Uniform: Shadows are rendered and projected using a uniform "
                                              868.                         "frustum for the whole light coverage. Simple and lowest quality.");
                                              869.                 cbo->addItem(li);
                                              870.                 cbo->setItemSelectState(li, true);
                                              871.                 cbo->setText("Uniform");
                                              872.                 mCurrentProjection = UNIFORM;
                                              873.                 li = new CEGUI::ListboxTextItem("Uniform Focused", UNIFORM_FOCUSED);
                                              874.         li->setSelectionBrushImage(selectImage);
                                              875.                 li->setTooltipText("Uniform Focused: As Uniform except that the frustum is "
                                              876.                         "focused on the visible area of the camera. Better quality than Uniform "
                                              877.                         "at the expense of some 'swimming'.");
                                              878.                 cbo->addItem(li);
                                              879.                 li = new CEGUI::ListboxTextItem("LiSPSM", LISPSM);
                                              880.         li->setSelectionBrushImage(selectImage);
                                              881.                 li->setTooltipText("LiSPSM: The frustum is distorted to take into account "
                                              882.                         "the perspective of the camera, and focused on the visible area. "
                                              883.                         "Good quality & flexibility.");
                                              884.                 cbo->addItem(li);
                                              885.                 li = new CEGUI::ListboxTextItem("Plane Optimal", PLANE_OPTIMAL);
                                              886.         li->setSelectionBrushImage(selectImage);
                                              887.                 li->setTooltipText("Plane Optimal: The frustum is optimised to project "
                                              888.                         "shadows onto a plane of interest. Best possible quality for the "
                                              889.                         "plane, less good for other receiver angles.");
                                              890.                 cbo->addItem(li);
                                              891.                 cbo = static_cast<CEGUI::Combobox*>(wmgr.getWindow("Shadows/Material"));
                                              892.                 cbo->getEditbox()->subscribeEvent(CEGUI::Window::EventMouseEnters,
                                              893.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnterCombo, this));
                                              894.                 cbo->getEditbox()->subscribeEvent(CEGUI::Window::EventMouseLeaves,
                                              895.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
                                              896.                 cbo->getDropList()->subscribeEvent(CEGUI::Window::EventMouseEnters,
                                              897.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnterCombo, this));
                                              898.                 cbo->getDropList()->subscribeEvent(CEGUI::Window::EventMouseLeaves,
                                              899.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
                                              900.                 cbo->getPushButton()->subscribeEvent(CEGUI::Window::EventMouseEnters,
                                              901.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnterCombo, this));
                                              902.                 cbo->getPushButton()->subscribeEvent(CEGUI::Window::EventMouseLeaves,
                                              903.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
                                              904.                 cbo->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted,
                                              905.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleMaterialChanged, this));
                                              906.                 li = new CEGUI::ListboxTextItem("Standard", MAT_STANDARD);
                                              907.                 li->setSelectionBrushImage(selectImage);
                                              908.                 li->setTooltipText("Standard Material: Shadows are rendered into a simple RGB texture "
                                              909.                         " and are received only by objects that are not themselves shadow casters "
                                              910.                         " (no self-shadowing)");
                                              911.                 cbo->addItem(li);
                                              912.                 cbo->setItemSelectState(li, true);
                                              913.                 cbo->setText("Standard");
                                              914.                 mCurrentMaterial = MAT_STANDARD;
                                              915.                 // Only add depth shadowmapping if supported
                                              916.                 if (GpuProgramManager::getSingleton().isSyntaxSupported("ps_2_0") ||
                                              917.                         GpuProgramManager::getSingleton().isSyntaxSupported("glsl"))
                                              918.                 {
                                              919.                         li = new CEGUI::ListboxTextItem("Depth Shadowmap", MAT_DEPTH_FLOAT);
                                              920.                         li->setSelectionBrushImage(selectImage);
                                              921.                         li->setTooltipText("Depth Shadowmap: Shadow caster depth is rendered into a "
                                              922.                                 " floating point texture and a depth comparison is performed on receivers "
                                              923.                                 " (self-shadowing allowed). Requires floating point textures and shader support.");
                                              924.                         cbo->addItem(li);
                                              925.                         li = new CEGUI::ListboxTextItem("Depth Shadowmap (PCF)", MAT_DEPTH_FLOAT_PCF);
                                              926.                         li->setSelectionBrushImage(selectImage);
                                              927.                         li->setTooltipText("Depth Shadowmap (PCF): Shadow caster depth is rendered into a "
                                              928.                                 " floating point texture and a depth comparison is performed on receivers "
                                              929.                                 " (self-shadowing allowed), with a percentage closest filter. Requires "
                                              930.                                 "floating point textures and shader support.");
                                              931.                         cbo->addItem(li);
                                              932.                 }
                                              933.                 CEGUI::RadioButton* radio = static_cast<CEGUI::RadioButton*>(
                                              934.                         wmgr.getWindow("Shadows/Stencil"));
                                              935.                 radio->setSelected(true);
                                              936.                 radio->subscribeEvent(CEGUI::RadioButton::EventSelectStateChanged,
                                              937.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleShadowTypeChanged, this));
                                              938.                 radio = static_cast<CEGUI::RadioButton*>(wmgr.getWindow("Shadows/Texture"));
                                              939.                 radio->subscribeEvent(CEGUI::RadioButton::EventSelectStateChanged,
                                              940.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleShadowTypeChanged, this));
                                              941.                 radio = static_cast<CEGUI::RadioButton*>(wmgr.getWindow("Shadows/Modulative"));
                                              942.                 radio->subscribeEvent(CEGUI::RadioButton::EventSelectStateChanged,
                                              943.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleShadowTypeChanged, this));
                                              944.                 radio = static_cast<CEGUI::RadioButton*>(wmgr.getWindow("Shadows/Additive"));
                                              945.                 radio->setSelected(true);
                                              946.                 radio->subscribeEvent(CEGUI::RadioButton::EventSelectStateChanged,
                                              947.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleShadowTypeChanged, this));
                                              948.                 mFixedBias = static_cast<CEGUI::Scrollbar*>(wmgr.getWindow("Shadows/DepthShadowTweakGroup/FixedBias"));
                                              949.                 mFixedBias->setScrollPosition(0.002f);
                                              950.                 mFixedBias->subscribeEvent(CEGUI::Scrollbar::EventScrollPositionChanged,
                                              951.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleParamsChanged, this));
                                              952.                 mGradientBias = static_cast<CEGUI::Scrollbar*>(wmgr.getWindow("Shadows/DepthShadowTweakGroup/SlopeBias"));
                                              953.                 mGradientBias->setScrollPosition(0.0008f);
                                              954.                 mGradientBias->subscribeEvent(CEGUI::Scrollbar::EventScrollPositionChanged,
                                              955.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleParamsChanged, this));
                                              956.                 mGradientClamp = static_cast<CEGUI::Scrollbar*>(wmgr.getWindow("Shadows/DepthShadowTweakGroup/SlopeClamp"));
                                              957.                 mGradientClamp->setScrollPosition(0.02f);
                                              958.                 mGradientClamp->subscribeEvent(CEGUI::Scrollbar::EventScrollPositionChanged,
                                              959.                         CEGUI::Event::Subscriber(&ShadowsApplication::handleParamsChanged, this));
                                              960.                 mDepthShadowTweak = wmgr.getWindow("Shadows/DepthShadowTweakGroup");
                                              961.                 mDepthShadowTweak->setVisible(false);
                                              962.                 mFixedBiasText = wmgr.getWindow("Shadows/DepthShadowTweakGroup/FixedBiasText");
                                              963.                 mGradientBiasText = wmgr.getWindow("Shadows/DepthShadowTweakGroup/SlopeBiasText");
                                              964.                 mGradientClampText = wmgr.getWindow("Shadows/DepthShadowTweakGroup/SlopeClampText");
                                              965.                 updateGUI(mCurrentShadowTechnique);
                                              966.         }
                                              967.         void updateGUI(ShadowTechnique newTech)
                                              968.         {
                                              969.                 bool isTextureBased = (newTech & SHADOWDETAILTYPE_TEXTURE) != 0;
                                              970.                 // Stencil based technique, turn off the texture-specific options
                                              971.                 CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
                                              972.                 CEGUI::Window* win = wmgr.getWindow("Shadows/Projection");
                                              973.                 win->setEnabled(isTextureBased);
                                              974.                 win = wmgr.getWindow("Shadows/Material");
                                              975.                 win->setEnabled(isTextureBased);
                                              976.         }
                                              977.         /// callback when mouse enters a described field (non-combo)
                                              978.         bool handleMouseEnter(const CEGUI::EventArgs& e)
                                              979.         {
                                              980.                 const CEGUI::WindowEventArgs& winargs =
                                              981.                         static_cast<const CEGUI::WindowEventArgs&>(e);
                                              982.                 mDescWindow->setText(winargs.window->getTooltipText());
                                              983.                 return true;
                                              984.         }
                                              985.         /// callback when mouse leaves a described field
                                              986.         bool handleMouseLeave(const CEGUI::EventArgs& e)
                                              987.         {
                                              988.                 //if (mDescWindow)
                                              989.                 //      mDescWindow->setText("");
                                              990.                 return true;
                                              991.         }
                                              992.         void updateTipForCombo(CEGUI::Combobox* cbo)
                                              993.         {
                                              994.                 CEGUI::String text = cbo->getTooltipText();
                                              995.                 text.append(" ");
                                              996.                 if (cbo->getSelectedItem())
                                              997.                         text.append(cbo->getSelectedItem()->getTooltipText());
                                              998.                 mDescWindow->setText(text);
                                              999.         }
                                              1000.         /// callback when mouse enters a described field (combo)
                                              1001.         bool handleMouseEnterCombo(const CEGUI::EventArgs& e)
                                              1002.         {
                                              1003.                 const CEGUI::WindowEventArgs& winargs =
                                              1004.                         static_cast<const CEGUI::WindowEventArgs&>(e);
                                              1005.                 // get tooltip from parent combo (events raised on contained components)
                                              1006.                 CEGUI::Combobox* cbo = static_cast<CEGUI::Combobox*>(winargs.window->getParent());
                                              1007.                 updateTipForCombo(cbo);
                                              1008.                 return true;
                                              1009.         }
                                              1010.         // Callback when a shadow type combo changed
                                              1011.         bool handleShadowTypeChanged(const CEGUI::EventArgs& e)
                                              1012.         {
                                              1013.                 // Only trigger change on selected
                                              1014.                 const CEGUI::WindowEventArgs& we = static_cast<const CEGUI::WindowEventArgs&>(e);
                                              1015.                 CEGUI::RadioButton* radio = static_cast<CEGUI::RadioButton*>(we.window);
                                              1016.                 if (radio->isSelected())
                                              1017.                 {
                                              1018.                         ShadowTechnique newTech = mCurrentShadowTechnique;
                                              1019.                         switch (radio->getID())
                                              1020.                         {
                                              1021.                         case 1:
                                              1022.                                 // stencil
                                              1023.                                 newTech = static_cast<ShadowTechnique>(
                                              1024.                                         (newTech & ~SHADOWDETAILTYPE_TEXTURE) | SHADOWDETAILTYPE_STENCIL);
                                              1025.                                 resetMaterials();
                                              1026.                                 break;
                                              1027.                         case 2:
                                              1028.                                 // texture
                                              1029.                                 newTech = static_cast<ShadowTechnique>(
                                              1030.                                         (newTech & ~SHADOWDETAILTYPE_STENCIL) | SHADOWDETAILTYPE_TEXTURE);
                                              1031.                                 break;
                                              1032.                         case 3:
                                              1033.                                 // additive
                                              1034.                                 newTech = static_cast<ShadowTechnique>(
                                              1035.                                         (newTech & ~SHADOWDETAILTYPE_MODULATIVE) | SHADOWDETAILTYPE_ADDITIVE);
                                              1036.                                 break;
                                              1037.                         case 4:
                                              1038.                                 // modulative
                                              1039.                                 newTech = static_cast<ShadowTechnique>(
                                              1040.                                         (newTech & ~SHADOWDETAILTYPE_ADDITIVE) | SHADOWDETAILTYPE_MODULATIVE);
                                              1041.                                 break;
                                              1042.                         }
                                              1043.                         changeShadowTechnique(newTech);
                                              1044.                 }
                                              1045.                 return true;
                                              1046.         }
                                              1047.         bool handleProjectionChanged(const CEGUI::EventArgs& e)
                                              1048.         {
                                              1049.                 const CEGUI::WindowEventArgs& winargs =
                                              1050.                         static_cast<const CEGUI::WindowEventArgs&>(e);
                                              1051.                 CEGUI::Combobox* cbo = static_cast<CEGUI::Combobox*>(winargs.window);
                                              1052.                 if (cbo->getSelectedItem())
                                              1053.                 {
                                              1054.                         ShadowProjection proj = (ShadowProjection)cbo->getSelectedItem()->getID();
                                              1055.                         if (proj != mCurrentProjection)
                                              1056.                         {
                                              1057.                                 switch(proj)
                                              1058.                                 {
                                              1059.                                 case UNIFORM:
                                              1060.                                         mCurrentShadowCameraSetup =
                                              1061.                                                 ShadowCameraSetupPtr(new DefaultShadowCameraSetup());
                                              1062.                                         break;
                                              1063.                                 case UNIFORM_FOCUSED:
                                              1064.                                         mCurrentShadowCameraSetup =
                                              1065.                                                 ShadowCameraSetupPtr(new FocusedShadowCameraSetup());
                                              1066.                                         break;
                                              1067.                                 case LISPSM:
                                              1068.                                         {
                                              1069.                                                 mLiSPSMSetup = new LiSPSMShadowCameraSetup();
                                              1070.                                                 //mLiSPSMSetup->setUseAggressiveFocusRegion(false);
                                              1071.                                                 mCurrentShadowCameraSetup = ShadowCameraSetupPtr(mLiSPSMSetup);
                                              1072.                                         }
                                              1073.                                         break;
                                              1074.                                 case PLANE_OPTIMAL:
                                              1075.                                         mCurrentShadowCameraSetup =
                                              1076.                                                 ShadowCameraSetupPtr(new PlaneOptimalShadowCameraSetup(mPlane));
                                              1077.                                         break;
                                              1078.                                 };
                                              1079.                                 mCurrentProjection = proj;
                                              1080.                                 mSceneMgr->setShadowCameraSetup(mCurrentShadowCameraSetup);
                                              1081.                                 updateTipForCombo(cbo);
                                              1082.                                 if (!mCustomRockwallVparams.isNull() && !mCustomRockwallFparams.isNull())
                                              1083.                                 {
                                              1084.                                         // set
                                              1085.                                         setDefaultDepthShadowParams();
                                              1086.                                 }
                                              1087.                         }
                                              1088.                 }
                                              1089.                 return true;
                                              1090.         }
                                              1091.         void updateDepthShadowParams()
                                              1092.         {
                                              1093.                 mCustomRockwallFparams->setNamedConstant("fixedDepthBias",
                                              1094.                         mFixedBias->getScrollPosition());
                                              1095.                 mCustomRockwallFparams->setNamedConstant("gradientScaleBias",
                                              1096.                         mGradientBias->getScrollPosition());
                                              1097.                 mCustomRockwallFparams->setNamedConstant("gradientClamp",
                                              1098.                         mGradientClamp->getScrollPosition());
                                              1099.                 mCustomAtheneFparams->setNamedConstant("fixedDepthBias",
                                              1100.                         mFixedBias->getScrollPosition());
                                              1101.                 mCustomAtheneFparams->setNamedConstant("gradientScaleBias",
                                              1102.                         mGradientBias->getScrollPosition());
                                              1103.                 mCustomAtheneFparams->setNamedConstant("gradientClamp",
                                              1104.                         mGradientClamp->getScrollPosition());
                                              1105.                 mFixedBiasText->setText(StringConverter::toString(
                                              1106.                         mFixedBias->getScrollPosition(), 4, 5, '0', std::ios::fixed));
                                              1107.                 mGradientBiasText->setText(StringConverter::toString(
                                              1108.                         mGradientBias->getScrollPosition(), 4, 5, '0', std::ios::fixed));
                                              1109.                 mGradientClampText->setText(StringConverter::toString(
                                              1110.                         mGradientClamp->getScrollPosition(), 4, 5, '0', std::ios::fixed));
                                              1111.         }
                                              1112.         void setDefaultDepthShadowParams()
                                              1113.         {
                                              1114.                 switch(mCurrentProjection)
                                              1115.                 {
                                              1116.                 case UNIFORM:
                                              1117.                 case UNIFORM_FOCUSED:
                                              1118.                 case PLANE_OPTIMAL:
                                              1119.                         mFixedBias->setScrollPosition(0.0f);
                                              1120.                         mGradientBias->setScrollPosition(0.0f);
                                              1121.                         break;
                                              1122.                 case LISPSM:
                                              1123.                         mFixedBias->setScrollPosition(0.009f);
                                              1124.                         mGradientBias->setScrollPosition(0.04f);
                                              1125.                         break;
                                              1126.                 };
                                              1127.                 updateDepthShadowParams();
                                              1128.         }
                                              1129.         bool handleParamsChanged(const CEGUI::EventArgs& e)
                                              1130.         {
                                              1131.                 if (!mCustomRockwallVparams.isNull() && !mCustomRockwallFparams.isNull())
                                              1132.                 {
                                              1133.                         updateDepthShadowParams();
                                              1134.                 }
                                              1135.                 return true;
                                              1136.         }
                                              1137.         void rebindDebugShadowOverlays()
                                              1138.         {
                                              1139.                 MaterialPtr debugMat =
                                              1140.                         MaterialManager::getSingleton().getByName("Ogre/DebugShadowMap0");
                                              1141.                 TexturePtr shadowTex = mSceneMgr->getShadowTexture(0);
                                              1142.                 debugMat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(shadowTex->getName());
                                              1143.                 debugMat =
                                              1144.                         MaterialManager::getSingleton().getByName("Ogre/DebugShadowMap1");
                                              1145.                 shadowTex = mSceneMgr->getShadowTexture(1);
                                              1146.                 debugMat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(shadowTex->getName());
                                              1147.         }
                                              1148.         void resetMaterials()
                                              1149.         {
                                              1150.                 // Sort out base materials
                                              1151.                 pPlaneEnt->setMaterialName(BASIC_ROCKWALL_MATERIAL);
                                              1152.                 mAthene->setMaterialName(BASIC_ATHENE_MATERIAL);
                                              1153.                 for (std::vector<Entity*>::iterator i = pColumns.begin();
                                              1154.                         i != pColumns.end(); ++i)
                                              1155.                 {
                                              1156.                         (*i)->setMaterialName(BASIC_ROCKWALL_MATERIAL);
                                              1157.                 }
                                              1158.                 mCustomRockwallVparams.setNull();
                                              1159.                 mCustomRockwallFparams.setNull();
                                              1160.                 mCustomAtheneVparams.setNull();
                                              1161.                 mCustomAtheneFparams.setNull();
                                              1162.         }
                                              1163.         bool handleMaterialChanged(const CEGUI::EventArgs& e)
                                              1164.         {
                                              1165.                 const CEGUI::WindowEventArgs& winargs =
                                              1166.                         static_cast<const CEGUI::WindowEventArgs&>(e);
                                              1167.                 CEGUI::Combobox* cbo = static_cast<CEGUI::Combobox*>(winargs.window);
                                              1168.                 if (cbo->getSelectedItem())
                                              1169.                 {
                                              1170.                         ShadowMaterial mat = (ShadowMaterial)cbo->getSelectedItem()->getID();
                                              1171.                         MaterialPtr themat;
                                              1172.                         if (mat != mCurrentMaterial)
                                              1173.                         {
                                              1174.                                 switch(mat)
                                              1175.                                 {
                                              1176.                                 case MAT_STANDARD:
                                              1177.                                         mSceneMgr->setShadowTexturePixelFormat(PF_L8);
                                              1178.                                         mSceneMgr->setShadowTextureCasterMaterial(StringUtil::BLANK);
                                              1179.                                         mSceneMgr->setShadowTextureReceiverMaterial(StringUtil::BLANK);
                                              1180.                                         mSceneMgr->setShadowTextureSelfShadow(false);   
                                              1181.                                         mDepthShadowTweak->setVisible(false);
                                              1182.                                         resetMaterials();
                                              1183.                                         break;
                                              1184.                                 case MAT_DEPTH_FLOAT:
                                              1185.                                         if (mIsOpenGL)
                                              1186.                                         {
                                              1187.                                                 // GL performs much better if you pick half-float format
                                              1188.                                                 mSceneMgr->setShadowTexturePixelFormat(PF_FLOAT16_R);
                                              1189.                                         }
                                              1190.                                         else
                                              1191.                                         {
                                              1192.                                                 // D3D is the opposite - if you ask for PF_FLOAT16_R you
                                              1193.                                                 // get an integer format instead! You can ask for PF_FLOAT16_GR
                                              1194.                                                 // but the precision doesn't work well
                                              1195.                                                 mSceneMgr->setShadowTexturePixelFormat(PF_FLOAT32_R);
                                              1196.                                         }
                                              1197.                                         mSceneMgr->setShadowTextureCasterMaterial(CUSTOM_CASTER_MATERIAL);
                                              1198.                                         mSceneMgr->setShadowTextureReceiverMaterial(CUSTOM_RECEIVER_MATERIAL);
                                              1199.                                         mSceneMgr->setShadowTextureSelfShadow(true);   
                                              1200.                                         // Sort out base materials
                                              1201.                                         pPlaneEnt->setMaterialName(CUSTOM_ROCKWALL_MATERIAL);
                                              1202.                                         mAthene->setMaterialName(CUSTOM_ATHENE_MATERIAL);
                                              1203.                                         for (std::vector<Entity*>::iterator i = pColumns.begin();
                                              1204.                                                 i != pColumns.end(); ++i)
                                              1205.                                         {
                                              1206.                                                 (*i)->setMaterialName(CUSTOM_ROCKWALL_MATERIAL);
                                              1207.                                         }
                                              1208.                                         themat = MaterialManager::getSingleton().getByName(CUSTOM_ROCKWALL_MATERIAL);
                                              1209.                                         mCustomRockwallVparams = themat->getTechnique(0)->getPass(1)->getShadowReceiverVertexProgramParameters();
                                              1210.                                         mCustomRockwallFparams = themat->getTechnique(0)->getPass(1)->getShadowReceiverFragmentProgramParameters();
                                              1211.                                         themat = MaterialManager::getSingleton().getByName(CUSTOM_ATHENE_MATERIAL);
                                              1212.                                         mCustomAtheneVparams = themat->getTechnique(0)->getPass(1)->getShadowReceiverVertexProgramParameters();
                                              1213.                                         mCustomAtheneFparams = themat->getTechnique(0)->getPass(1)->getShadowReceiverFragmentProgramParameters();
                                              1214.                                         mDepthShadowTweak->setVisible(true);
                                              1215.                                         // set the current params
                                              1216.                                         setDefaultDepthShadowParams();
                                              1217.                                         break;
                                              1218.                                 case MAT_DEPTH_FLOAT_PCF:
                                              1219.                                         if (mIsOpenGL)
                                              1220.                                         {
                                              1221.                                                 // GL performs much better if you pick half-float format
                                              1222.                                                 mSceneMgr->setShadowTexturePixelFormat(PF_FLOAT16_R);
                                              1223.                                         }
                                              1224.                                         else
                                              1225.                                         {
                                              1226.                                                 // D3D is the opposite - if you ask for PF_FLOAT16_R you
                                              1227.                                                 // get an integer format instead! You can ask for PF_FLOAT16_GR
                                              1228.                                                 // but the precision doesn't work well
                                              1229.                                                 mSceneMgr->setShadowTexturePixelFormat(PF_FLOAT32_R);
                                              1230.                                         }
                                              1231.                                         mSceneMgr->setShadowTextureCasterMaterial(CUSTOM_CASTER_MATERIAL);
                                              1232.                                         mSceneMgr->setShadowTextureReceiverMaterial(CUSTOM_RECEIVER_MATERIAL + "/PCF");
                                              1233.                                         mSceneMgr->setShadowTextureSelfShadow(true);   
                                              1234.                                         // Sort out base materials
                                              1235.                                         pPlaneEnt->setMaterialName(CUSTOM_ROCKWALL_MATERIAL + "/PCF");
                                              1236.                                         mAthene->setMaterialName(CUSTOM_ATHENE_MATERIAL + "/PCF");
                                              1237.                                         for (std::vector<Entity*>::iterator i = pColumns.begin();
                                              1238.                                                 i != pColumns.end(); ++i)
                                              1239.                                         {
                                              1240.                                                 (*i)->setMaterialName(CUSTOM_ROCKWALL_MATERIAL + "/PCF");
                                              1241.                                         }
                                              1242.                                         themat = MaterialManager::getSingleton().getByName(CUSTOM_ROCKWALL_MATERIAL + "/PCF");
                                              1243.                                         mCustomRockwallVparams = themat->getTechnique(0)->getPass(1)->getShadowReceiverVertexProgramParameters();
                                              1244.                                         mCustomRockwallFparams = themat->getTechnique(0)->getPass(1)->getShadowReceiverFragmentProgramParameters();
                                              1245.                                         themat = MaterialManager::getSingleton().getByName(CUSTOM_ATHENE_MATERIAL + "/PCF");
                                              1246.                                         mCustomAtheneVparams = themat->getTechnique(0)->getPass(1)->getShadowReceiverVertexProgramParameters();
                                              1247.                                         mCustomAtheneFparams = themat->getTechnique(0)->getPass(1)->getShadowReceiverFragmentProgramParameters();
                                              1248.                                         mDepthShadowTweak->setVisible(true);
                                              1249.                                         // set the current params
                                              1250.                                         setDefaultDepthShadowParams();
                                              1251.                                         break;
                                              1252.                                 };
                                              1253.                                 mCurrentMaterial = mat;
                                              1254.                                 updateTipForCombo(cbo);
                                              1255.                                 rebindDebugShadowOverlays();
                                              1256.                         }
                                              1257.                 }
                                              1258.                 return true;
                                              1259.         }
                                              1260.     // Create new frame listener
                                              1261.     void createFrameListener(void)
                                              1262.     {
                                              1263.         ShadowsListener* shadowListener = new ShadowsListener(mWindow, mCamera, mSceneMgr);
                                              1264.                 mFrameListener = shadowListener;
                                              1265.         mFrameListener->showDebugOverlay(true);
                                              1266.         mRoot->addFrameListener(mFrameListener);
                                              1267.                 // Hook up Root sheet (handles main input)
                                              1268.                 CEGUI::Window* wnd = CEGUI::WindowManager::getSingleton().getWindow("Shadows");
                                              1269.                 wnd->subscribeEvent(CEGUI::Window::EventMouseMove,
                                              1270.                         CEGUI::Event::Subscriber(&ShadowsListener::handleMouseMove, shadowListener));
                                              1271.                 wnd->subscribeEvent(CEGUI::Window::EventMouseButtonUp,
                                              1272.                         CEGUI::Event::Subscriber(&ShadowsListener::handleMouseButtonUp, shadowListener));
                                              1273.                 wnd->subscribeEvent(CEGUI::Window::EventMouseButtonDown,
                                              1274.                         CEGUI::Event::Subscriber(&ShadowsListener::handleMouseButtonDown, shadowListener));
                                              1275.                 wnd->subscribeEvent(CEGUI::Window::EventMouseWheel,
                                              1276.                         CEGUI::Event::Subscriber(&ShadowsListener::handleMouseWheelEvent, shadowListener));
                                              1277.                 wnd->subscribeEvent(CEGUI::Window::EventKeyDown,
                                              1278.                         CEGUI::Event::Subscriber(&ShadowsListener::handleKeyDownEvent, shadowListener ));
                                              1279.                 wnd->subscribeEvent(CEGUI::Window::EventKeyUp,
                                              1280.                         CEGUI::Event::Subscriber(&ShadowsListener::handleKeyUpEvent, shadowListener ));
                                              1281.     }
                                              1282. public:
                                              1283.     void go(void)
                                              1284.     {
                                              1285.         if (!setup())
                                              1286.             return;
                                              1287.         mRoot->startRendering();
                                              1288.     }
                                              1289. };
                                              1290. #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
                                              1291. #define WIN32_LEAN_AND_MEAN
                                              1292. #include "windows.h"
                                              1293. #endif
                                              1294. #ifdef __cplusplus
                                              1295. extern "C" {
                                              1296. #endif
                                              1297. #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
                                              1298. INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
                                              1299. #else
                                              1300. int main(int argc, char *argv[])
                                              1301. #endif
                                              1302. {
                                              1303.     // Create application object
                                              1304.     ShadowsApplication app;
                                              1305.     try {
                                              1306.         app.go();
                                              1307.     } catch( Ogre::Exception& e ) {
                                              1308. #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
                                              1309.         MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
                                              1310. #else
                                              1311.         std::cerr << "An exception has occured: " <<
                                              1312.             e.getFullDescription().c_str() << std::endl;
                                              1313. #endif
                                              1314.     }
                                              1315.     return 0;
                                              1316. }
                                              1317. #ifdef __cplusplus
                                              1318. }
                                              1319. #endif


                                              Quand j'appuie sur F9 pour compiler, j'ai cette fenetre qui s'ouvre :

                                              Image utilisateur

                                              J'ai donc deux choix : debug ou release.

                                              Si je choisis debug et j'appuie sur OK ça me donne encore les fenetres suivantes :

                                              Image utilisateur

                                              Maintenant si je choisis release, ça me donne ceci :

                                              "La fenetre ou il y a Ogre et son dessin, je peux pas mettre une capture car j'ai plus de place mais cette image je l'ai déjà poster dans un poste précédent dans ce topic bien sur."


                                              Dans les deux cas, que ce sois je clic sur debug ou release, l'histoire finie toujours pas ce mesage :

                                              Image utilisateur

                                              Je n'est fait aucune application Ogre depuis le lancement de ce topic car j'ai du mal à le configurer dans le bon sens, j'ai cherher sur le web et tout le monde dit que la configuration de Ogre est extremement difficile et ils ont raison :p .

                                              PS : J'ai le meme probleme meme dans le cas d'autres démos dans simples :(

                                              deltaOne
                                              • Partager sur Facebook
                                              • Partager sur Twitter
                                                25 septembre 2007 à 10:32:40

                                                Quand tu compiles en débug, ajoute la lib OIS_d.lib et en mode release: OIS.lib.

                                                Vérifie aussi le path du load de tes meshs:
                                                Dans ton dossier contenant le binaire (par défaut) il y a un ressources.cfg Edite le et vérifie que les paths sont sous cette forme:
                                                "FileSystem=../../media"
                                                "FileSystem=../../media/fonts"
                                                etc...
                                                Puis à partir du fichier contenant ton binaire, remonte 2 fois en dossier parent (correspondant au ../../) et vérifie que donc le dossier principal contient le dossier media. Si non, copie celui fournit dans le SDK d'ogre dans le répertoire de ton projet.

                                                Télécharge aussi la dll directx demandée et mets la dans ton projet.
                                                • Partager sur Facebook
                                                • Partager sur Twitter
                                                  28 septembre 2007 à 6:47:29

                                                  Salut deltaOne j'avais le meme probleme que toi voila comment je l'ai réglé : dans le dossier system32 de windows, il y a un fichier nommé d3dx9_30.dll tu le copie et tu le place dans le dosier bin de Ogre tu le rennome en d3dx9d_30.dll et sa devrait marcher. ;)
                                                  • Partager sur Facebook
                                                  • Partager sur Twitter
                                                    12 octobre 2007 à 19:16:55

                                                    Merci mehdi541
                                                    Tu a raison, j'ai fait ce que tu m'a dit et maintenant j'ai juste un seul message d'erreurs, malgres que j'ai pas installer Visual Studio je c'est pas pourquoi il m'affiche ça !!

                                                    Voila la fenetre qui donne cette erreur depuis la demo cameraTrack :

                                                    Image utilisateur

                                                    J'ai essayer encore ce code ci dessous :
                                                    1. // ----------------------------------------------------------------------------
                                                    2. #include <Ogre.h>
                                                    3. // ----------------------------------------------------------------------------
                                                    4. // Include the OGRE example framework
                                                    5. // This includes the classes defined to make getting an OGRE application running
                                                    6. // a lot easier. It automatically sets up all the main objects and allows you to
                                                    7. // just override the bits you want to instead of writing it all from scratch.
                                                    8. // ----------------------------------------------------------------------------
                                                    9. #include <ExampleApplication.h>
                                                    10. // ----------------------------------------------------------------------------
                                                    11. // Define the application object
                                                    12. // This is derived from ExampleApplication which is the class OGRE provides to
                                                    13. // make it easier to set up OGRE without rewriting the same code all the time.
                                                    14. // You can override extra methods of ExampleApplication if you want to further
                                                    15. // specialise the setup routine, otherwise the only mandatory override is the
                                                    16. // 'createScene' method which is where you set up your own personal scene.
                                                    17. // ----------------------------------------------------------------------------
                                                    18. class SampleApp : public ExampleApplication
                                                    19. {
                                                    20. public:
                                                    21.     // Basic constructor
                                                    22.     SampleApp()
                                                    23.     {}
                                                    24. protected:
                                                    25.     // Just override the mandatory create scene method
                                                    26.     void createScene(void)
                                                    27.     {
                                                    28.         // Create the SkyBox
                                                    29.         mSceneMgr->setSkyBox(true, "Examples/CloudyNoonSkyBox");
                                                    30.         // Create a light
                                                    31.         Light* myLight = mSceneMgr->createLight("Light0");
                                                    32.         myLight->setType(Light::LT_POINT);
                                                    33.         myLight->setPosition(0, 40, 0);
                                                    34.         myLight->setDiffuseColour(1, 1, 1);
                                                    35.         myLight->setSpecularColour(1, 1, 1);
                                                    36.     }
                                                    37. };
                                                    38. // ----------------------------------------------------------------------------
                                                    39. // Main function, just boots the application object
                                                    40. // ----------------------------------------------------------------------------
                                                    41. #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
                                                    42. #define WIN32_LEAN_AND_MEAN
                                                    43. #include "windows.h"
                                                    44. INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
                                                    45. #else
                                                    46. int main(int argc, char **argv)
                                                    47. #endif
                                                    48. {
                                                    49.     // Create application object
                                                    50.     SampleApp app;
                                                    51.     try
                                                    52.     {
                                                    53.         app.go();
                                                    54.     }
                                                    55.     catch( Exception& e )
                                                    56.     {
                                                    57. #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
                                                    58.         MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
                                                    59. #else
                                                    60.         std::cerr << "An exception has occured: " << e.getFullDescription();
                                                    61. #endif
                                                    62.     }
                                                    63.     return 0;
                                                    64. }


                                                    Ce code m'affiche ce message :

                                                    Image utilisateur

                                                    Je clic sur oui, et ça compile puis rien ne ce passe après ! dans l'onglet build log j'ai ça :
                                                    1. d000061.o: multiple definition of `_imp___ZN4Ogre4Math8fDeg2RadE'
                                                    2. d000025.o: first defined here
                                                    3. d000061.o: multiple definition of `_nm___ZN4Ogre4Math8fDeg2RadE'
                                                    4. d000025.o: first defined here
                                                    5. d000062.o: multiple definition of `_imp___ZN4Ogre7Vector34ZEROE'
                                                    6. d000045.o: first defined here
                                                    7. d000062.o: multiple definition of `_nm___ZN4Ogre7Vector34ZEROE'
                                                    8. d000045.o: first defined here
                                                    9. Process terminated with status 1 (0 minutes, 0 seconds)
                                                    10. 0 errors, 0 warnings



                                                    deltaOne
                                                    • Partager sur Facebook
                                                    • Partager sur Twitter

                                                    [Ogre] PB de configuration sous Code Blocks

                                                    × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
                                                    × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
                                                    • Editeur
                                                    • Markdown