1. Hesham Wahba
  2. ibex

Commits

Hesham Wahba  committed d04501e

Typo fix from last commit for Ogre plugin, virtual display fix and cleanup

- fix missing / to find plugins directory
- use physicalWidth/Height for Ogre virtual display
- add headers for Ogre cmake stuff

  • Participants
  • Parent commits 0dad71a
  • Branches master

Comments (0)

Files changed (5)

File IbexMac/CMakeLists.txt

View file
  • Ignore whitespace
     if( OGRE_FOUND  )
       add_definitions( -DENABLE_OGRE3D )
       #set(OGRE_INCLUDE_FLAGS "-I${OGRE_INCLUDE_DIRS}")
-      set(OGRE_PLUGIN_FILES "ogre3d_plugin/BaseApplication.cpp" "ogre3d_plugin/TutorialApplication.cpp" "ogre3d_plugin/DotSceneLoader.cpp")
+      set(OGRE_PLUGIN_FILES "ogre3d_plugin/BaseApplication.cpp" "ogre3d_plugin/TutorialApplication.cpp" "ogre3d_plugin/DotSceneLoader.cpp"
+      "ogre3d_plugin/BaseApplication.h" "ogre3d_plugin/TutorialApplication.h" "ogre3d_plugin/DotSceneLoader.h"
+      "ogre3d_plugin/NativeRenderSystemCommands.h"
+         )
 
       include_directories( ${OIS_INCLUDE_DIRS}
             ${OGRE_INCLUDE_DIRS}

File IbexMac/ogre3d_plugin/BaseApplication.cpp

View file
  • Ignore whitespace
 //-------------------------------------------------------------------------------------
 void BaseApplication::go(void)
 {
-    Ogre::String workingDir = Ogre::macBundlePath()+"/Contents/Resources";
+    Ogre::String workingDir = Ogre::macBundlePath()+"/Contents/Resources/";
     chdir(workingDir.c_str());
     std::cout << "working directory: "+workingDir+"\n";
     

File IbexMac/ogre3d_plugin/NativeRenderSystemCommands.h

View file
  • Ignore whitespace
 
   void NativeRender()
   {
-      static bool init = false;
-      if(!init) {
-          init = true;
-          startDesktopCapture(0, 0);
-      }
-    const double s = (double)width/(double)height;
+    static bool init = false;
+    if(!init) {
+      init = true;
+      startDesktopCapture(0, 0);
+    }
+    const double s = (physicalHeight != 0) ? (double)physicalWidth/(double)physicalHeight : (double)width/(double)height;
 
     glEnable(GL_DEPTH_TEST);
     glDisable(GL_CULL_FACE);

File IbexMac/ogre3d_plugin/TutorialApplication.cpp

View file
  • Ignore whitespace
 #include <RenderSystems/GL/OgreGLTextureManager.h>
 
 #include "DotSceneLoader.h"
+#include "../ibex.h"
 
 using namespace Ogre;
 
     GLTexturePtr t = GLTextureManager::getSingleton().createManual("DynamicTexture", // name
         Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
         Ogre::TEX_TYPE_2D,      // type
-        1280, 800,         // width & height
+        physicalWidth, physicalHeight,         // width & height
         1, //depth
         MIP_DEFAULT,//0,                // number of mipmaps
         Ogre::PF_BYTE_RGBA,     // pixel format
   Ogre::MeshManager::getSingleton().createPlane("OceanSurface",
           Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
           oceanSurface,
-          5000, 5000, 50, 50, true, 1, 1, 1, Ogre::Vector3::UNIT_Z);
+          3000, 3000, 40, 40, true, 1, 1, 1, Ogre::Vector3::UNIT_Z);
 
   Entity *pWaterEntity = mSceneMgr->createEntity( "OceanSurface", "OceanSurface" );
   mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pWaterEntity);

File README.md

View file
  • Ignore whitespace
     cmake .. -G "Unix Makefiles" -DINSTALL_LIBS=ON #-DBUILD_SHARED_LIBS=ON                                                                                                                   
     make -j4
     sudo make install
+    
+Updated cmake install method:
+
+	# at the same level as the ibex checkout directory
+    mkdir build
+    cmake -DCMAKE_INSTALL_PREFIX:PATH=`pwd` ../ibex/IbexMac
+    make install
+or
+
+	# at the same level as the ibex checkout directory
+	mkdir build
+    cmake -DCMAKE_INSTALL_PREFIX:PATH=`pwd` ../ibex/IbexMac -G Xcode
+    # switch to the ibex_run target and hit Command+B
 
 ### Windows
 Visual Studio 2012 - Build and run from Visual Studio, Rift SDK must be at same level as ibex folder and named: OculusSDK.