diff --git a/CMakeLists.txt b/CMakeLists.txt index 381659c4d..fc6f3353a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,10 +101,10 @@ set(OENGINE_OGRE ${LIBDIR}/openengine/ogre/mouselook.cpp ) set(OENGINE_GUI -# ${LIBDIR}/openengine/gui/events.cpp + ${LIBDIR}/openengine/gui/events.cpp ${LIBDIR}/openengine/gui/manager.cpp -) # Not yet included in main executable -set(OENGINE_ALL ${OENGINE_OGRE}) +) +set(OENGINE_ALL ${OENGINE_OGRE} ${OENGINE_GUI}) source_group(libs\\openengine FILES ${OENGINE_ALL}) set(OPENMW_LIBS ${MANGLE_ALL} ${OENGINE_ALL}) diff --git a/apps/mygui_dev/CMakeLists.txt b/apps/mygui_dev/CMakeLists.txt index 0219bd2c6..82facd067 100644 --- a/apps/mygui_dev/CMakeLists.txt +++ b/apps/mygui_dev/CMakeLists.txt @@ -3,6 +3,7 @@ add_executable(mygui_test ${BSA} ${BSA_HEADER} ${OENGINE_OGRE} ${OENGINE_GUI} + ${MANGLE_INPUT} ) target_link_libraries(mygui_test ${OGRE_LIBRARIES} diff --git a/apps/mygui_dev/main.cpp b/apps/mygui_dev/main.cpp index 96412e5fd..c21f1eb62 100644 --- a/apps/mygui_dev/main.cpp +++ b/apps/mygui_dev/main.cpp @@ -2,8 +2,11 @@ using namespace std; #include +#include #include +#include + #include #include @@ -12,29 +15,24 @@ using namespace std; #include #include +#include + // Frame listener struct Listener : public Ogre::FrameListener { bool exit; - float total; - int step; - Listener() : exit(false), total(0.0), step(0) {} + Mangle::Input::Driver *input; + + Listener() : exit(false) {} bool frameStarted(const Ogre::FrameEvent &evt) { - total += evt.timeSinceLastFrame; + if(input) + input->capture(); - // Countdown to exit - const int MAX = 4; - if(total >= step) - { - step++; - if(stepisDown(OIS::KC_ESCAPE)) + exit = true; return !exit; } @@ -59,6 +57,10 @@ int main() // 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"; @@ -67,6 +69,10 @@ int main() int w = ogre.getWindow()->getWidth(); int h = ogre.getWindow()->getHeight(); + 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 layouts\n"; MWGUI::HUD hud(w,h); MWGUI::MapWindow map; @@ -79,24 +85,10 @@ int main() stats.setVisible(true); cout << "Starting rendering loop\n"; + cout << "PRESS ESCAPE TO EXIT\n"; ogre.start(); ogre.screenshot("mygui_test.png"); cout << "Done.\n"; return 0; } - -/// Old D function -/* -extern "C" MyGUI::WidgetPtr gui_createText(const char *skin, - int32_t x, int32_t y, - int32_t w, int32_t h, - const char *layer) -{ - return mGUI->createWidget - (skin, - x,y,w,h, - MyGUI::ALIGN_LEFT | MyGUI::ALIGN_TOP, - layer); -} -*/ diff --git a/libs/mangle b/libs/mangle index 9f21081c1..c7b179d65 160000 --- a/libs/mangle +++ b/libs/mangle @@ -1 +1 @@ -Subproject commit 9f21081c13f70bc41e20b50c19ed2dac9b458833 +Subproject commit c7b179d6546688208528c8eef681d42b7c1ec7be diff --git a/libs/openengine b/libs/openengine index 69a56e867..fedb1a802 160000 --- a/libs/openengine +++ b/libs/openengine @@ -1 +1 @@ -Subproject commit 69a56e867749944dc0e86b9ef5c54bac4339b454 +Subproject commit fedb1a80256a093511075aeb88408c7c56a136ce