forked from teamnwah/openmw-tes3coop
Moved GUI stuff into components
parent
29522f57d3
commit
9c839e220e
@ -1 +1,2 @@
|
|||||||
build
|
build
|
||||||
|
*~
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
old
|
||||||
|
run.sh
|
@ -1,58 +0,0 @@
|
|||||||
#ifndef ENGINE_MYGUI_MANAGER_H
|
|
||||||
#define ENGINE_MYGUI_MANAGER_H
|
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include <MyGUI.h>
|
|
||||||
#include <MyGUI_OgrePlatform.h>
|
|
||||||
|
|
||||||
namespace GUI
|
|
||||||
{
|
|
||||||
class MyGUIManager
|
|
||||||
{
|
|
||||||
MyGUI::OgrePlatform *mPlatform;
|
|
||||||
MyGUI::Gui *mGui;
|
|
||||||
|
|
||||||
public:
|
|
||||||
MyGUIManager() : mPlatform(NULL), mGui(NULL) {}
|
|
||||||
MyGUIManager(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool logging=false)
|
|
||||||
{ setup(wnd,mgr,logging); }
|
|
||||||
~MyGUIManager() { shutdown(); }
|
|
||||||
|
|
||||||
void setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool logging=false)
|
|
||||||
{
|
|
||||||
assert(wnd);
|
|
||||||
assert(mgr);
|
|
||||||
|
|
||||||
using namespace MyGUI;
|
|
||||||
|
|
||||||
// Enable/disable MyGUI logging to stdout. (Logging to MyGUI.log
|
|
||||||
// is still enabled.) In order to do this we have to initialize
|
|
||||||
// the log manager before the main gui system itself, otherwise
|
|
||||||
// the main object will get the chance to spit out a few messages
|
|
||||||
// before we can able to disable it.
|
|
||||||
LogManager::initialise();
|
|
||||||
LogManager::setSTDOutputEnabled(logging);
|
|
||||||
|
|
||||||
// Set up OGRE platform. We might make this more generic later.
|
|
||||||
mPlatform = new OgrePlatform();
|
|
||||||
mPlatform->initialise(wnd, mgr);
|
|
||||||
|
|
||||||
// Create GUI
|
|
||||||
mGui = new Gui();
|
|
||||||
mGui->initialise();
|
|
||||||
}
|
|
||||||
|
|
||||||
void shutdown()
|
|
||||||
{
|
|
||||||
if(mGui) delete mGui;
|
|
||||||
if(mPlatform)
|
|
||||||
{
|
|
||||||
mPlatform->shutdown();
|
|
||||||
delete mPlatform;
|
|
||||||
}
|
|
||||||
mGui = NULL;
|
|
||||||
mPlatform = NULL;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
#endif
|
|
@ -0,0 +1,43 @@
|
|||||||
|
#include <MyGUI.h>
|
||||||
|
#include <MyGUI_OgrePlatform.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include "manager.hpp"
|
||||||
|
|
||||||
|
using namespace GUI;
|
||||||
|
|
||||||
|
void MyGUIManager::setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool logging)
|
||||||
|
{
|
||||||
|
assert(wnd);
|
||||||
|
assert(mgr);
|
||||||
|
|
||||||
|
using namespace MyGUI;
|
||||||
|
|
||||||
|
// Enable/disable MyGUI logging to stdout. (Logging to MyGUI.log is
|
||||||
|
// still enabled.) In order to do this we have to initialize the log
|
||||||
|
// manager before the main gui system itself, otherwise the main
|
||||||
|
// object will get the chance to spit out a few messages before we
|
||||||
|
// can able to disable it.
|
||||||
|
LogManager::initialise();
|
||||||
|
LogManager::setSTDOutputEnabled(logging);
|
||||||
|
|
||||||
|
// Set up OGRE platform. We might make this more generic later.
|
||||||
|
mPlatform = new OgrePlatform();
|
||||||
|
mPlatform->initialise(wnd, mgr);
|
||||||
|
|
||||||
|
// Create GUI
|
||||||
|
mGui = new Gui();
|
||||||
|
mGui->initialise();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyGUIManager::shutdown()
|
||||||
|
{
|
||||||
|
if(mGui) delete mGui;
|
||||||
|
if(mPlatform)
|
||||||
|
{
|
||||||
|
mPlatform->shutdown();
|
||||||
|
delete mPlatform;
|
||||||
|
}
|
||||||
|
mGui = NULL;
|
||||||
|
mPlatform = NULL;
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
#ifndef ENGINE_MYGUI_MANAGER_H
|
||||||
|
#define ENGINE_MYGUI_MANAGER_H
|
||||||
|
|
||||||
|
namespace MyGUI
|
||||||
|
{
|
||||||
|
class OgrePlatform;
|
||||||
|
class Gui;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace Ogre
|
||||||
|
{
|
||||||
|
class RenderWindow;
|
||||||
|
class SceneManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace GUI
|
||||||
|
{
|
||||||
|
class MyGUIManager
|
||||||
|
{
|
||||||
|
MyGUI::OgrePlatform *mPlatform;
|
||||||
|
MyGUI::Gui *mGui;
|
||||||
|
|
||||||
|
public:
|
||||||
|
MyGUIManager() : mPlatform(NULL), mGui(NULL) {}
|
||||||
|
MyGUIManager(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool logging=false)
|
||||||
|
{ setup(wnd,mgr,logging); }
|
||||||
|
~MyGUIManager() { shutdown(); }
|
||||||
|
|
||||||
|
void setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool logging=false);
|
||||||
|
void shutdown();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
#endif
|
@ -1,7 +1,20 @@
|
|||||||
#ifndef MWGUI_LAYOUTS_H
|
#ifndef MWGUI_LAYOUTS_H
|
||||||
#define MWGUI_LAYOUTS_H
|
#define MWGUI_LAYOUTS_H
|
||||||
|
|
||||||
#include "layout.hpp"
|
#include <components/engine/gui/layout.hpp>
|
||||||
|
|
||||||
|
/*
|
||||||
|
This file contains classes corresponding to all the window layouts
|
||||||
|
defined in resources/mygui/ *.xml.
|
||||||
|
|
||||||
|
Each class inherites GUI::Layout and loads the XML file, and
|
||||||
|
provides some helper functions to manipulate the elements of the
|
||||||
|
window.
|
||||||
|
|
||||||
|
The windows are never created or destroyed (except at startup and
|
||||||
|
shutdown), they are only hid. You can control visibility with
|
||||||
|
setVisible().
|
||||||
|
*/
|
||||||
|
|
||||||
namespace MWGUI
|
namespace MWGUI
|
||||||
{
|
{
|
Loading…
Reference in New Issue