Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 35 for code/branches


Ignore:
Timestamp:
Oct 11, 2007, 10:35:49 AM (17 years ago)
Author:
nicolasc
Message:

reset all files to original state
included all win32/macosx ifdefs…

Location:
code/branches/tutorial/Tutorial/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tutorial/Tutorial/src/ExampleApplication.h

    r30 r35  
    2626#include "ExampleFrameListener.h"
    2727
    28 #if 0
    2928#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
    3029#include <CoreFoundation/CoreFoundation.h>
     
    5352}
    5453#endif
    55 #endif
    5654
    5755using namespace Ogre;
     
    7169                // On windows files are searched for in the current working directory, on OS X however
    7270                // you must provide the full path, the helper function macBundlePath does this for us.
     71#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
     72                mResourcePath = macBundlePath() + "/Contents/Resources/";
     73#else
    7374                mResourcePath = "";
     75#endif
    7476    }
    7577    /// Standard destructor
     
    219221                typeName = i->first;
    220222                archName = i->second;
     223#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
     224                // OS X does not set the working directory relative to the app,
     225                // In order to make things portable on OS X we need to provide
     226                // the loading with it's own bundle path location
     227                ResourceGroupManager::getSingleton().addResourceLocation(
     228                    String(macBundlePath() + "/" + archName), typeName, secName);
     229#else
    221230                ResourceGroupManager::getSingleton().addResourceLocation(
    222231                    archName, typeName, secName);
     232#endif
    223233            }
    224234        }
  • code/branches/tutorial/Tutorial/src/ExampleFrameListener.h

    r30 r35  
    5050{
    5151protected:
    52 
    5352        void updateStats(void)
    5453        {
     
    8483                        guiDbg->setCaption(mDebugText);
    8584                }
    86                 catch(...) { }
     85                catch(...) { /* ignore */ }
    8786        }
    8887
  • code/branches/tutorial/Tutorial/src/main.cpp

    r30 r35  
    5858};
    5959
    60 //#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    61 //#define WIN32_LEAN_AND_MEAN
    62 //#include "windows.h"
     60#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
     61#define WIN32_LEAN_AND_MEAN
     62#include "windows.h"
    6363
    64 //INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
    65 //#else
     64INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
     65#else
    6666int main(int argc, char **argv)
    67 //#endif
     67#endif
    6868{
    6969    // Create application object
     
    7373        app.go();
    7474    } catch( Exception& e ) {
    75 //#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    76 //        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
    77 //#else
     75#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
     76        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
     77#else
    7878        fprintf(stderr, "An exception has occurred: %s\n",
    7979                e.getFullDescription().c_str());
    80 //#endif
     80#endif
    8181    }
    8282
Note: See TracChangeset for help on using the changeset viewer.