Commit b8d700c2 authored by Jussi Lindgren's avatar Jussi Lindgren

Everything: Towards Ogre 1.9.0 and CEGUI 0.8.4 support

parent 0c67f99d
......@@ -13,6 +13,13 @@ using namespace OpenViBE;
using namespace OpenViBE::Kernel;
using namespace OpenViBESSVEP;
#if !((CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7))
namespace CEGUI
{
typedef CEGUI::UVector2 USize;
};
#endif
CShooterApplication::CShooterApplication()
: CApplication(),
m_bTargetRequest( false ),
......@@ -42,11 +49,15 @@ bool CShooterApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContex
m_poInstructionsReady = m_poGUIWindowManager->createWindow("TaharezLook/StaticImage", "InstructionsReady");
m_poInstructionsReady->setPosition(CEGUI::UVector2(cegui_reldim(0.0f), cegui_reldim(0.0f)) );
m_poInstructionsReady->setSize(CEGUI::UVector2(CEGUI::UDim(0.0f, 640.f), CEGUI::UDim(0.0f, 32.f)));
m_poInstructionsReady->setSize(CEGUI::USize(CEGUI::UDim(0.0f, 640.f), CEGUI::UDim(0.0f, 32.f)));
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
m_poSheet->addChild(m_poInstructionsReady);
CEGUI::ImageManager::getSingleton().addFromImageFile("InstructionsReady","InstructionText-Start.png");
#else
m_poSheet->addChildWindow(m_poInstructionsReady);
CEGUI::ImagesetManager::getSingleton().createFromImageFile("InstructionsReady","InstructionText-Start.png");
CEGUI::ImagesetManager::getSingleton().createFromImageFile("InstructionsReady", "InstructionText-Start.png");
#endif
m_poInstructionsReady->setProperty("Image","set:InstructionsReady image:full_image");
m_poInstructionsReady->setProperty("FrameEnabled","False");
......
......@@ -46,7 +46,8 @@ CStarShip::CStarShip(CApplication* poApplication, Ogre::SceneNode* poParentNode,
SceneNode* l_poDrawnObjectNode;
MovableObject* l_poDrawnObject;
Ogre::Rectangle l_oWingRectangle = { - rRadius * 0.4f, rRadius * 0.4f, rRadius * 0.4f, -rRadius * 0.4f };
// Ogre::RealRect l_oWingRectangle = { - rRadius * 0.4f, rRadius * 0.4f, rRadius * 0.4f, -rRadius * 0.4f };
Ogre::RealRect l_oWingRectangle(-rRadius * 0.4f, rRadius * 0.4f, rRadius * 0.4f, -rRadius * 0.4f );
// paint the cannon
......
......@@ -12,7 +12,14 @@ using namespace OpenViBE;
using namespace OpenViBE::Kernel;
using namespace OpenViBESSVEP;
CTrainerApplication::CTrainerApplication() :
#if !((CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7))
namespace CEGUI
{
typedef CEGUI::UVector2 USize;
};
#endif
CTrainerApplication::CTrainerApplication() :
CApplication(),
m_bActive( false ),
m_poInstructionsReady( NULL )
......@@ -41,11 +48,15 @@ bool CTrainerApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContex
// draw the initial text
m_poInstructionsReady = m_poGUIWindowManager->createWindow("TaharezLook/StaticImage", "InstructionsReady");
m_poInstructionsReady->setPosition(CEGUI::UVector2(cegui_reldim(0.0f), cegui_reldim(0.0f)) );
m_poInstructionsReady->setSize(CEGUI::UVector2(CEGUI::UDim(0.0f, 640.f), CEGUI::UDim(0.0f, 32.f)));
m_poInstructionsReady->setSize(CEGUI::USize(CEGUI::UDim(0.0f, 640.f), CEGUI::UDim(0.0f, 32.f)));
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
m_poSheet->addChild(m_poInstructionsReady);
CEGUI::ImageManager::getSingleton().addFromImageFile("InstructionsReady","InstructionText-Start.png");
#else
m_poSheet->addChildWindow(m_poInstructionsReady);
CEGUI::ImagesetManager::getSingleton().createFromImageFile("InstructionsReady","InstructionText-Start.png");
CEGUI::ImagesetManager::getSingleton().createFromImageFile("InstructionsReady", "InstructionText-Start.png");
#endif
m_poInstructionsReady->setProperty("Image","set:InstructionsReady image:full_image");
m_poInstructionsReady->setProperty("FrameEnabled","False");
......
......@@ -81,7 +81,7 @@ CTrainerFlickeringObject::CTrainerFlickeringObject( OpenViBE::float32 f32PosX, O
m_poObjectNode = m_poElementNode->createChildSceneNode();
l_poPointerNode = m_poElementNode->createChildSceneNode();
Ogre::Rectangle l_oRectangle = { f32PosX - m_f32TargetWidth / 2, f32PosY + m_f32TargetHeight / 2, f32PosX + m_f32TargetWidth / 2, f32PosY - m_f32TargetHeight / 2};
Ogre::RealRect l_oRectangle(f32PosX - m_f32TargetWidth / 2, f32PosY + m_f32TargetHeight / 2, f32PosX + m_f32TargetWidth / 2, f32PosY - m_f32TargetHeight / 2);
l_poLitObject = m_poPainter->paintRectangle( l_oRectangle, oColour );
......
......@@ -209,14 +209,25 @@ void CApplication::initCEGUI(const char *logFilename)
(*m_poLogManager) << LogLevel_Debug << "+ Creating CEGUI Ogre bootstrap\n";
m_roGUIRenderer = &(CEGUI::OgreRenderer::bootstrapSystem(*m_poWindow));
(*m_poLogManager) << LogLevel_Debug << "+ Creating CEGUI Scheme Manager\n";
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
CEGUI::SchemeManager::getSingleton().createFromFile((CEGUI::utf8*)"TaharezLook-ov.scheme");
#else
CEGUI::SchemeManager::getSingleton().create((CEGUI::utf8*)"TaharezLook-ov.scheme");
#endif
(*m_poLogManager) << LogLevel_Debug << "+ Creating CEGUI WindowManager\n";
m_poGUIWindowManager = CEGUI::WindowManager::getSingletonPtr();
m_poSheet = m_poGUIWindowManager->createWindow("DefaultWindow", "Sheet");
(*m_poLogManager) << LogLevel_Debug << "+ Setting CEGUI StyleSheet\n";
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
// @FIXME
#else
CEGUI::System::getSingleton().setGUISheet(m_poSheet);
#endif
}
void CApplication::resizeViewport()
......
......@@ -9,7 +9,11 @@
#include <Ogre.h>
#include <vector>
#include <CEGUI.h>
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
#include <CEGUI/RendererModules/Ogre/Renderer.h>
#else
#include <RendererModules/Ogre/CEGUIOgreRenderer.h>
#endif
#include "ovassvepICommand.h"
#include "ovassvepCBasicPainter.h"
......
......@@ -4,6 +4,9 @@
#include "ovassvepCBasicPainter.h"
#include "ovassvepCApplication.h"
#if (OGRE_VERSION_MAJOR > 1) || ((OGRE_VERSION_MAJOR == 1) && (OGRE_VERSION_MINOR >= 9))
#include "Overlay/OgreOverlayManager.h"
#endif
using namespace Ogre;
using namespace OpenViBESSVEP;
......@@ -32,7 +35,7 @@ using namespace OpenViBE::Kernel;
ManualObject* CBasicPainter::paintRectangle( Ogre::Rectangle oRectangle, Ogre::ColourValue oColour, int iPlane )
ManualObject* CBasicPainter::paintRectangle( Ogre::RealRect oRectangle, Ogre::ColourValue oColour, int iPlane )
{
ManualObject *l_poObject;
......
......@@ -3,6 +3,11 @@
#include <Ogre.h>
#if (OGRE_VERSION_MAJOR > 1) || ((OGRE_VERSION_MAJOR == 1) && (OGRE_VERSION_MINOR >= 9))
#include "Overlay/OgreOverlay.h"
#include "Overlay/OgreOverlayContainer.h"
#endif
#define SSVEP_DEFAULT_COLOUR Ogre::ColourValue(1.0f, 1.0f, 1.0f)
namespace OpenViBESSVEP
......@@ -25,7 +30,7 @@ namespace OpenViBESSVEP
CBasicPainter( CApplication* poApplication );
~CBasicPainter() {};
Ogre::ManualObject* paintRectangle( Ogre::Rectangle oRectangle, Ogre::ColourValue oColour = SSVEP_DEFAULT_COLOUR, int iPlane = 1 );
Ogre::ManualObject* paintRectangle( Ogre::RealRect oRectangle, Ogre::ColourValue oColour = SSVEP_DEFAULT_COLOUR, int iPlane = 1 );
Ogre::ManualObject* paintTriangle( Point oP1, Point oP2, Point oP3, Ogre::ColourValue oColour = SSVEP_DEFAULT_COLOUR, int iPlane = 1 );
Ogre::ManualObject* paintCircle( Ogre::Real rX, Ogre::Real rY, Ogre::Real rR, Ogre::ColourValue = SSVEP_DEFAULT_COLOUR, bool bFilled = true, int iPlane = 1);
......
......@@ -28,7 +28,8 @@ INCLUDE("FindOpenViBEModuleEBML")
INCLUDE("FindOpenViBEModuleFS")
INCLUDE("FindThirdPartyCEGUI") # CEGUI + CEGUIOgreRender included
INCLUDE("FindThirdPartyVRPN")
INCLUDE("FindThirdPartyOgre3DTerrain") # OGRE + OIS included, pulls boost thread
INCLUDE("FindThirdPartyOgre3D")
INCLUDE("FindThirdPartyOgre3DTerrain") # OGRE + OIS included, pulls boost thread
INCLUDE("FindThirdPartyBoost") # Using Ogre headers on Win32 causes dependency to Boost thread library
INCLUDE("FindThirdPartyBoost_Thread") # Note that this is a potential issue on Windows, as the dependencies/ogre/boost and dependencies/boost are not the same at the time of writing this.
......
......@@ -14,7 +14,14 @@ using namespace OpenViBE;
using namespace OpenViBE::Kernel;
using namespace OpenViBESSVEP;
CGenericStimulatorApplication::CGenericStimulatorApplication(CString sScenarioDir) :
#if !((CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7))
namespace CEGUI
{
typedef CEGUI::UVector2 USize;
};
#endif
CGenericStimulatorApplication::CGenericStimulatorApplication(CString sScenarioDir) :
CApplication(sScenarioDir),
m_bActive( false ),
m_poInstructionsReady( NULL )
......@@ -52,11 +59,15 @@ bool CGenericStimulatorApplication::setup(OpenViBE::Kernel::IKernelContext* poKe
// draw the initial text
m_poInstructionsReady = m_poGUIWindowManager->createWindow("TaharezLook/StaticImage", "InstructionsReady");
m_poInstructionsReady->setPosition(CEGUI::UVector2(cegui_reldim(0.0f), cegui_reldim(0.0f)) );
m_poInstructionsReady->setSize(CEGUI::UVector2(CEGUI::UDim(0.0f, 640.f), CEGUI::UDim(0.0f, 32.f)));
m_poInstructionsReady->setSize(CEGUI::USize(CEGUI::UDim(0.0f, 640.f), CEGUI::UDim(0.0f, 32.f)));
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
m_poSheet->addChild(m_poInstructionsReady);
CEGUI::ImageManager::getSingleton().addFromImageFile("InstructionsReady","InstructionText-Start.png");
#else
m_poSheet->addChildWindow(m_poInstructionsReady);
CEGUI::ImagesetManager::getSingleton().createFromImageFile("InstructionsReady","InstructionText-Start.png");
CEGUI::ImagesetManager::getSingleton().createFromImageFile("InstructionsReady", "InstructionText-Start.png");
#endif
m_poInstructionsReady->setProperty("Image","set:InstructionsReady image:full_image");
m_poInstructionsReady->setProperty("FrameEnabled","False");
......
......@@ -106,7 +106,7 @@ CGenericStimulatorFlickeringObject::CGenericStimulatorFlickeringObject( OpenViBE
m_poObjectNode = m_poElementNode->createChildSceneNode();
l_poPointerNode = m_poElementNode->createChildSceneNode();
Ogre::Rectangle l_oRectangle = { f32PosX - m_f32TargetWidth / 2, f32PosY + m_f32TargetHeight / 2, f32PosX + m_f32TargetWidth / 2, f32PosY - m_f32TargetHeight / 2};
Ogre::RealRect l_oRectangle( f32PosX - m_f32TargetWidth / 2, f32PosY + m_f32TargetHeight / 2, f32PosX + m_f32TargetWidth / 2, f32PosY - m_f32TargetHeight / 2);
if (strcmp(sMaterial.toASCIIString(), "default") == 0)
{
......
......@@ -29,6 +29,13 @@ using namespace OpenViBESSVEP;
//#define NO_KEYBOARD
//#define NO_VRPN
#if !((CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7))
namespace CEGUI
{
typedef CEGUI::UVector2 USize;
};
#endif
CImpactApplication::CImpactApplication(CString sScenarioDir, CString sApplicationSubtype)
: CApplication(sScenarioDir),
m_poCurrentEnemy( NULL ),
......@@ -121,8 +128,13 @@ bool CImpactApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContext
m_poStatusWindow->setFont("BlueHighway-impact");
m_poStatusWindow->hide();
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
m_poSheet->addChild(m_poStatusWindow);
m_poSheet->addChild(m_poInstructionWindow);
#else
m_poSheet->addChildWindow(m_poStatusWindow);
m_poSheet->addChildWindow(m_poInstructionWindow);
#endif
// Create commands
......@@ -184,7 +196,7 @@ bool CImpactApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContext
// draw the initial text
m_poInstructionWindow->show();
m_poInstructionWindow->setSize( CEGUI::UVector2( CEGUI::UDim( 0.50f, 0 ), CEGUI::UDim( 0.10f, 0 ) ) );
m_poInstructionWindow->setSize( CEGUI::USize( CEGUI::UDim( 0.50f, 0 ), CEGUI::UDim( 0.10f, 0 ) ) );
m_poInstructionWindow->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.25f, 0 ), CEGUI::UDim( 0.45f, 0 ) ) );
// m_poInstructionWindow->setText("Appuyez sur la touche ESPACE pour commencer le jeu ...");
m_poInstructionWindow->setText("Press SPACE to start the game ...");
......@@ -195,7 +207,7 @@ bool CImpactApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContext
// draw the initial text
m_poInstructionWindow->show();
m_poInstructionWindow->setSize( CEGUI::UVector2( CEGUI::UDim( 0.50f, 0 ), CEGUI::UDim( 0.15f, 0 ) ) );
m_poInstructionWindow->setSize( CEGUI::USize( CEGUI::UDim( 0.50f, 0 ), CEGUI::UDim( 0.15f, 0 ) ) );
m_poInstructionWindow->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.25f, 0 ), CEGUI::UDim( 0.425f, 0 ) ) );
// m_poInstructionWindow->setText("Le systeme a besoin de faire quelques reglages.\nVeuillez vous concentrer sur les cibles indiques par les instructions.\n\nAppuyez sur la touche ESPACE pour commencer l'entrainement ...");
m_poInstructionWindow->setText("The system needs to calibrate.\nPlease concentrate on the targets as instructed.\n\nPlease press SPACE to start the process ...");
......@@ -474,7 +486,7 @@ void CImpactApplication::addTarget(OpenViBE::uint32 ui32TargetPosition)
break;
}
m_poInstructionWindow->setSize( CEGUI::UVector2( CEGUI::UDim( l_fTextSize, 0 ), CEGUI::UDim( 0.10f, 0 ) ) );
m_poInstructionWindow->setSize( CEGUI::USize( CEGUI::UDim( l_fTextSize, 0 ), CEGUI::UDim( 0.10f, 0 ) ) );
m_poInstructionWindow->setPosition( CEGUI::UVector2( CEGUI::UDim( (1.0f - l_fTextSize) / 2.0f, 0 ), CEGUI::UDim( 0.45f, 0 ) ) );
m_poInstructionWindow->show();
m_ui32DialogHideDelay = DIALOG_CYCLES_TO_REMOVE;
......@@ -541,7 +553,7 @@ void CImpactApplication::startExperiment()
m_poInstructionWindow->hide();
m_ui32DialogHideDelay = 0;
m_poStatusWindow->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.0f, 0 ), CEGUI::UDim( 0.0f, 0 ) ) );
m_poStatusWindow->setSize( CEGUI::UVector2( CEGUI::UDim( 0.15f, 0 ), CEGUI::UDim( 0.05f, 0 ) ) );
m_poStatusWindow->setSize( CEGUI::USize( CEGUI::UDim( 0.15f, 0 ), CEGUI::UDim( 0.05f, 0 ) ) );
m_poStatusWindow->setText("Score: 0");
m_poStatusWindow->show();
m_eGameState = STARTED;
......@@ -566,7 +578,7 @@ void CImpactApplication::stopExperiment()
OpenViBE::float32 l_fTextSize = 0.35f;
// m_poInstructionWindow->setText("L'application va prendre quelque temps pour le calcul, veuillez patienter.\nLe jeu va commencer automatiquement une fois l'application est prete.");
m_poInstructionWindow->setText("The application needs some time to compute, please be patient.\nThe game starts automatically when the application is ready.");
m_poInstructionWindow->setSize( CEGUI::UVector2( CEGUI::UDim( l_fTextSize, 0 ), CEGUI::UDim( 0.10f, 0 ) ) );
m_poInstructionWindow->setSize( CEGUI::USize( CEGUI::UDim( l_fTextSize, 0 ), CEGUI::UDim( 0.10f, 0 ) ) );
m_poInstructionWindow->setPosition( CEGUI::UVector2( CEGUI::UDim( (1.0f - l_fTextSize) / 2.0f, 0 ), CEGUI::UDim( 0.45f, 0 ) ) );
m_poInstructionWindow->show();
......@@ -581,7 +593,7 @@ void CImpactApplication::stopExperiment()
// sprintf(l_sText, "Bravo!\nVous avez obtenu %d points!\nAppuyez sur ECHAP pour fermer le programme", m_iScore);
sprintf(l_sText, "Bravo!\nYou have obtained %d points!\nPress ESC to close the program", m_iScore);
m_poInstructionWindow->setText(l_sText);
m_poInstructionWindow->setSize( CEGUI::UVector2( CEGUI::UDim( l_fTextSize, 0 ), CEGUI::UDim( 0.10f, 0 ) ) );
m_poInstructionWindow->setSize( CEGUI::USize( CEGUI::UDim( l_fTextSize, 0 ), CEGUI::UDim( 0.10f, 0 ) ) );
m_poInstructionWindow->setPosition( CEGUI::UVector2( CEGUI::UDim( (1.0f - l_fTextSize) / 2.0f, 0 ), CEGUI::UDim( 0.45f, 0 ) ) );
m_poInstructionWindow->show();
m_bActive = false;
......
......@@ -284,14 +284,23 @@ void CApplication::initCEGUI()
(*m_poLogManager) << LogLevel_Debug << "+ Creating CEGUI Ogre bootstrap\n";
m_roGUIRenderer = &(CEGUI::OgreRenderer::bootstrapSystem(*m_poWindow));
(*m_poLogManager) << LogLevel_Debug << "+ Creating CEGUI Scheme Manager\n";
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
CEGUI::SchemeManager::getSingleton().createFromFile((CEGUI::utf8*)"TaharezLook-ov.scheme");
#else
CEGUI::SchemeManager::getSingleton().create((CEGUI::utf8*)"TaharezLook-ov.scheme");
#endif
(*m_poLogManager) << LogLevel_Debug << "+ Creating CEGUI WindowManager\n";
m_poGUIWindowManager = CEGUI::WindowManager::getSingletonPtr();
m_poSheet = m_poGUIWindowManager->createWindow("DefaultWindow", "RootSheet");
(*m_poLogManager) << LogLevel_Debug << "+ Setting CEGUI StyleSheet\n";
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
// @FIXME
#else
CEGUI::System::getSingleton().setGUISheet(m_poSheet);
#endif
}
void CApplication::resizeViewport()
......
......@@ -9,7 +9,11 @@
#include <Ogre.h>
#include <vector>
#include <CEGUI.h>
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
#include <CEGUI/RendererModules/Ogre/Renderer.h>
#else
#include <RendererModules/Ogre/CEGUIOgreRenderer.h>
#endif
#include "ovassvepICommand.h"
#include "ovassvepCBasicPainter.h"
......
......@@ -4,6 +4,10 @@
#include "ovassvepCBasicPainter.h"
#include "ovassvepCApplication.h"
#if (OGRE_VERSION_MAJOR > 1) || ((OGRE_VERSION_MAJOR == 1) && (OGRE_VERSION_MINOR >= 9))
#include "Overlay/OgreOverlayContainer.h"
#include "Overlay/OgreOverlayElement.h"
#endif
using namespace Ogre;
using namespace OpenViBESSVEP;
......@@ -32,7 +36,7 @@ using namespace OpenViBE::Kernel;
ManualObject* CBasicPainter::paintRectangle( Ogre::Rectangle oRectangle, Ogre::ColourValue oColour, int iPlane )
ManualObject* CBasicPainter::paintRectangle( Ogre::RealRect oRectangle, Ogre::ColourValue oColour, int iPlane )
{
ManualObject *l_poObject;
......@@ -69,7 +73,7 @@ ManualObject* CBasicPainter::paintRectangle( Ogre::Rectangle oRectangle, Ogre::C
return l_poObject;
}
ManualObject* CBasicPainter::paintTexturedRectangle( Ogre::Rectangle oRectangle, Ogre::String sSurface, int iPlane)
ManualObject* CBasicPainter::paintTexturedRectangle( Ogre::RealRect oRectangle, Ogre::String sSurface, int iPlane)
{
ManualObject *l_poObject;
......
......@@ -5,6 +5,10 @@
#include <Ogre.h>
#if (OGRE_VERSION_MAJOR > 1) || ((OGRE_VERSION_MAJOR == 1) && (OGRE_VERSION_MINOR >= 9))
#include "Overlay/OgreOverlayManager.h"
#endif
#define SSVEP_DEFAULT_COLOUR Ogre::ColourValue(1.0f, 1.0f, 1.0f)
namespace OpenViBESSVEP
......@@ -22,8 +26,8 @@ namespace OpenViBESSVEP
return m_poSceneManager;
}
Ogre::ManualObject* paintRectangle( Ogre::Rectangle oRectangle, Ogre::ColourValue oColour = SSVEP_DEFAULT_COLOUR, int iPlane = 1 );
Ogre::ManualObject* paintTexturedRectangle( Ogre::Rectangle oRectangle, Ogre::String sSurface, int iPlane = 1 );
Ogre::ManualObject* paintRectangle( Ogre::RealRect oRectangle, Ogre::ColourValue oColour = SSVEP_DEFAULT_COLOUR, int iPlane = 1 );
Ogre::ManualObject* paintTexturedRectangle( Ogre::RealRect oRectangle, Ogre::String sSurface, int iPlane = 1 );
Ogre::ManualObject* paintTriangle( Ogre::Vector2 oP1, Ogre::Vector2 oP2, Ogre::Vector2 oP3, Ogre::ColourValue oColour = SSVEP_DEFAULT_COLOUR, int iPlane = 1 );
Ogre::ManualObject* paintTriangle( Ogre::Vector3 oP1, Ogre::Vector3 oP2, Ogre::Vector3 oP3, Ogre::ColourValue oColour = SSVEP_DEFAULT_COLOUR, int iPlane = 1 );
Ogre::ManualObject* paintTexturedTriangle( Ogre::Vector2 oP1, Ogre::Vector2 oP2, Ogre::Vector2 oP3, Ogre::String sSurface, int iPlane = 1 );
......
......@@ -269,12 +269,20 @@ bool COgreVRApplication::initCEGUI(const char *logFilename)
m_rGUIRenderer = &(CEGUI::OgreRenderer::bootstrapSystem(*m_poWindow));
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
CEGUI::SchemeManager::getSingleton().createFromFile((CEGUI::utf8*)"TaharezLook-ov.scheme");
#else
CEGUI::SchemeManager::getSingleton().create((CEGUI::utf8*)"TaharezLook-ov.scheme");
#endif
m_poGUIWindowManager = CEGUI::WindowManager::getSingletonPtr();
m_poSheet = m_poGUIWindowManager->createWindow("DefaultGUISheet", "Sheet");
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
// @FIXME
#else
CEGUI::System::getSingleton().setGUISheet(m_poSheet);
#endif
return true;
}
......@@ -408,7 +416,11 @@ bool COgreVRApplication::frameStarted(const FrameEvent& evt)
void COgreVRApplication::windowResized(RenderWindow* rw)
{
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
CEGUI::System::getSingleton().notifyDisplaySizeChanged(CEGUI::Sizef((float)rw->getWidth(), (float)rw->getHeight()));
#else
CEGUI::System::getSingleton().notifyDisplaySizeChanged(CEGUI::Size((float)rw->getWidth(), (float)rw->getHeight()));
#endif
}
#endif
\ No newline at end of file
......@@ -5,7 +5,11 @@
#include <Ogre.h>
#include <OIS.h>
#include <CEGUI.h>
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
#include <CEGUI/RendererModules/Ogre/Renderer.h>
#else
#include <RendererModules/Ogre/CEGUIOgreRenderer.h>
#endif
#include "ovaCAbstractVrpnPeripheral.h"
......
......@@ -22,8 +22,8 @@ IF(WIN32)
SET(CEGUI_FOUND TRUE)
SET(OgreCEGUIRenderer_FOUND TRUE)
SET(CEGUI_INCLUDE_DIRS ${PATH_CEGUI}/cegui/include)
SET(CEGUI_LIBRARIES_DEBUG CEGUIBase_d CEGUIOgreRenderer_d)
SET(CEGUI_LIBRARIES_RELEASE CEGUIBase CEGUIOgreRenderer)
SET(CEGUI_LIBRARIES_DEBUG CEGUIBase-0_d CEGUIOgreRenderer-0_d)
SET(CEGUI_LIBRARIES_RELEASE CEGUIBase-0 CEGUIOgreRenderer-0)
SET(CEGUI_LIBRARY_DIRS ${PATH_CEGUI}/lib)
ENDIF(PATH_CEGUI)
ENDIF(WIN32)
......
......@@ -20,19 +20,16 @@ IF(OV_DISABLE_OGRE)
ENDIF(OV_DISABLE_OGRE)
IF(WIN32)
MESSAGE(STATUS "Disabling OGRE until recompiled with VC120 ...")
RETURN()
FIND_PATH(PATH_Ogre3D include/OGRE/Ogre.h PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/ogre $ENV{OGRE_HOME})
IF(PATH_Ogre3D)
SET(Ogre3D_FOUND TRUE)
SET(OIS_FOUND TRUE)
SET(Ogre3D_INCLUDE_DIRS ${PATH_Ogre3D}/include/OGRE ${PATH_Ogre3D}/include/OIS)
SET(Ogre3D_LIBRARIES_RELEASE OgreMain OIS)
SET(Ogre3D_LIBRARIES_RELEASE OgreMain OgreOverlay OIS)
SET(Ogre3D_LIBRARY_DIRS_RELEASE ${PATH_Ogre3D}/lib/Release)
SET(Ogre3D_LIBRARIES_DEBUG OgreMain_d OIS_d)
SET(Ogre3D_LIBRARIES_DEBUG OgreMain_d OgreOverlay_d OIS_d)
SET(Ogre3D_LIBRARY_DIRS_DEBUG ${PATH_Ogre3D}/lib/Debug)
ENDIF(PATH_Ogre3D)
ENDIF(WIN32)
......
......@@ -7,15 +7,24 @@
#include "OgreRenderSystem.h"
#include "OgreStringConverter.h"
#if (OGRE_VERSION_MAJOR > 1) || ((OGRE_VERSION_MAJOR == 1) && (OGRE_VERSION_MINOR >= 9))
#include "Overlay/OgreOverlayManager.h"
#include "Overlay/OgreOverlayElement.h"
#endif
using namespace std;
using namespace Ogre;
COgreFrameListener::COgreFrameListener(RenderWindow* win) :
m_pRenderWindow(win),
m_pDebugOverlay(0)
m_pDebugOverlay(NULL)
{
//FIXME : the overlay should be cloned for each window, as opposed to shared betwen windows!!
#if (OGRE_VERSION_MAJOR > 1) || ((OGRE_VERSION_MAJOR == 1) && (OGRE_VERSION_MINOR >= 9))
// @FIXME
#else
m_pDebugOverlay = OverlayManager::getSingleton().getByName("Core/DebugOverlay");
#endif
//Register as a Window listener
//WindowEventUtilities::addWindowEventListener(m_pRenderWindow, this);
......@@ -50,6 +59,11 @@ bool COgreFrameListener::frameEnded(const FrameEvent& evt)
void COgreFrameListener::updateStats(void)
{
if (!m_pDebugOverlay)
{
return;
}
static String currFps = "Current FPS: ";
static String avgFps = "Average FPS: ";
static String bestFps = "Best FPS: ";
......
......@@ -5,6 +5,10 @@
#include "OgreStringConverter.h"
#include "OgreException.h"
#if (OGRE_VERSION_MAJOR > 1) || ((OGRE_VERSION_MAJOR == 1) && (OGRE_VERSION_MINOR >= 9))
#include "Overlay/OgreOverlay.h"
#endif
class COgreFrameListener: public Ogre::FrameListener//, public Ogre::WindowEventListener
{
public:
......
......@@ -412,9 +412,10 @@ void COgreVisualisation::addResourceLocations(const std::string& resourcesFile)
{
try
{
this->getLogManager() << LogLevel_Trace << "Loading resources file\n";
//load resource paths from config file
ConfigFile configFile;
this->getLogManager() << LogLevel_Trace << "Loading resources file\n";
configFile.load(resourcesFile);
String resourceGroupName;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment