mirror of https://github.com/OpenMW/openmw.git
Killed mygui_dev
parent
c84672a560
commit
5472a8c760
@ -1,2 +0,0 @@
|
||||
old
|
||||
run.sh
|
@ -1,14 +0,0 @@
|
||||
add_executable(mygui_test
|
||||
main.cpp
|
||||
${BSA} ${BSA_HEADER}
|
||||
${MWGUI} ${MWGUI_HEADER}
|
||||
${OENGINE_OGRE}
|
||||
${OENGINE_GUI}
|
||||
${MANGLE_INPUT}
|
||||
)
|
||||
target_link_libraries(mygui_test
|
||||
${OGRE_LIBRARIES}
|
||||
${OIS_LIBRARIES}
|
||||
MyGUIEngine
|
||||
MyGUI.OgrePlatform
|
||||
)
|
@ -1,85 +0,0 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include <openengine/gui/manager.hpp>
|
||||
#include <openengine/gui/events.hpp>
|
||||
#include <openengine/ogre/renderer.hpp>
|
||||
|
||||
#include <mangle/input/servers/ois_driver.hpp>
|
||||
|
||||
#include <components/mwgui/window_manager.hpp>
|
||||
#include <components/bsa/bsa_archive.hpp>
|
||||
|
||||
#include <OgreResourceGroupManager.h>
|
||||
#include <OgreRenderWindow.h>
|
||||
#include <OgreFrameListener.h>
|
||||
#include <OgreRoot.h>
|
||||
|
||||
#include <OIS/OISKeyboard.h>
|
||||
|
||||
// Frame listener
|
||||
struct Listener : public Ogre::FrameListener
|
||||
{
|
||||
bool exit;
|
||||
|
||||
Mangle::Input::Driver *input;
|
||||
|
||||
Listener() : exit(false) {}
|
||||
|
||||
bool frameStarted(const Ogre::FrameEvent &evt)
|
||||
{
|
||||
if(input)
|
||||
input->capture();
|
||||
|
||||
if(input->isDown(OIS::KC_ESCAPE))
|
||||
exit = true;
|
||||
|
||||
return !exit;
|
||||
}
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
OEngine::Render::OgreRenderer ogre;
|
||||
ogre.configure(false, "plugins.cfg", false);
|
||||
ogre.createWindow("MyGUI test");
|
||||
ogre.createScene();
|
||||
|
||||
Listener listener;
|
||||
ogre.getRoot()->addFrameListener(&listener);
|
||||
|
||||
cout << "Adding data path and BSA\n";
|
||||
// Add the Morrowind window resources
|
||||
Ogre::ResourceGroupManager::getSingleton().
|
||||
addResourceLocation("resources/mygui/", "FileSystem", "General");
|
||||
|
||||
// And add the BSA, since most of the window bitmaps are located
|
||||
// there
|
||||
addBSA("data/Morrowind.bsa");
|
||||
|
||||
cout << "Setting up input with OIS\n";
|
||||
Mangle::Input::OISDriver input(ogre.getWindow());
|
||||
listener.input = &input;
|
||||
|
||||
// Make sure you load the data paths BEFORE you initialize the
|
||||
// GUI. MyGUI depends on finding core.xml in resources/mygui/.
|
||||
cout << "Setting up MyGUI\n";
|
||||
OEngine::GUI::MyGUIManager gui(ogre.getWindow(), ogre.getScene());
|
||||
|
||||
cout << "Connecting to input\n";
|
||||
OEngine::GUI::EventInjector *evt = new OEngine::GUI::EventInjector(gui.getGui());
|
||||
input.setEvent(Mangle::Input::EventPtr(evt));
|
||||
|
||||
cout << "Setting up the window manager\n";
|
||||
MWGui::WindowManager gm(gui.getGui());
|
||||
|
||||
gm.setMode(MWGui::GM_Inventory);
|
||||
|
||||
cout << "Starting rendering loop\n";
|
||||
cout << "PRESS ESCAPE TO EXIT\n";
|
||||
ogre.start();
|
||||
ogre.screenshot("mygui_test.png");
|
||||
|
||||
cout << "Done.\n";
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue