/SleekThink.depend
75625,7 → 75625,7
<memory.h>
<GL/gl.h>
 
1423260293 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/app/GameCore.cpp
1423260386 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/app/GameCore.cpp
"GameCore.h"
"../sleek/loader/texture_loader.h"
 
75634,9 → 75634,10
"GameEngine.h"
"GameIntro.h"
 
1420933988 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/app/GameMenu.h
1423266049 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/app/GameMenu.h
"../sleek/start.h"
"../sleek/gui/interface.h"
"GuiEventMapper.h"
 
1422751935 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/start.h
"device/device.h"
77600,10 → 77601,9
"../sleek/start.h"
"../sleek/driver/mesh.h"
 
1423173419 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/app/GameEngine.cpp
1423266033 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/app/GameEngine.cpp
"GameCore.h"
"GameEngine.h"
"light.h"
"../sleek/loader/texture_loader.h"
 
1422762241 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/app/light.h
79841,7 → 79841,7
<theora/TheoraVideoClip.h>
<queue>
 
1423171360 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/video/video.cpp
1423260374 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/video/video.cpp
"../driver/context.h"
"video.h"
<theora/TheoraDataSource.h>
81060,7 → 81060,7
<vector>
<memory>
 
1420843974 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/device/event.h
1423266085 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/device/event.h
"../os/os.h"
"../gui/type.h"
"keycode.h"
81690,3 → 81690,7
<GL/glx.h>
<windows.h>
 
1423266096 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/app/GuiEventMapper.h
"../gui/frame.h"
<map>
 
/bin/SleekThink
Cannot display: file marked as a binary type.
svn:mime-type = application/x-executable
/src/app/GameEngine.cpp
104,9 → 104,7
static_crate = smgr->getNumberNode();
 
smgr->getCamera()->setRotation(math::vector3df(0, 1, 0));
smgr->getCamera()->setTarget(math::vector3df(0, 0, 0));
 
light_test();
smgr->getCamera()->setTarget(math::vector3df(0, 0, 0));
}
 
GameEngine::~GameEngine() noexcept
/src/app/GameMenu.h
2,7 → 2,8
#define GAME_MENU
 
#include "../sleek/start.h"
#include "../sleek/gui/interface.h"
#include "../sleek/gui/interface.h"
#include "GuiEventMapper.h"
 
namespace interne
{
/src/app/GuiEventMapper.h
0,0 → 1,51
#include "../gui/frame.h"
#include <map>
 
namespace interne
{
/**
* usage sample:
* auto t = new GuiEventMapper<sleek::gui::button>(@interface);
* t->absolute = {0, 0, 100, 20};
* t->box = t->absolute.minimise();
* t->mapped[sleek::gui::IET_BUTTON_CLICKED] =
* []() {
* // do_stuff
* return true;
* };
*/
 
template<class T>
class GuiEventMapper : public T
{
public:
using mapped_func = std::function<bool()>;
std::map<sleek::gui::INTERFACE_EVENT_CODE, mapped_func> mapped;
public:
template<typename ...Args>
GuiEventMapper(Args... args) : T(args...) { }
virtual ~GuiEventMapper(){ }
 
virtual bool manage(sleek::device::input *a) noexcept
{
if(!T::manage(a))
return false;
 
if(a->gui.called != this)
return true;
 
auto m = mapped[a->gui.code];
 
if(m)
{
// notify empty event
// else the modified @a input from @T
// can be remanaged later
a->clear();
return m();
}
 
return true;
}
};
}
Property changes:
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: src/sleek/device/event.h
===================================================================
--- src/sleek/device/event.h (revision 10)
+++ src/sleek/device/event.h (revision 11)
@@ -55,7 +55,7 @@
struct
{
- class gui::frame*called;
+ class gui::frame *called;
gui::INTERFACE_GUI_CODE type;
gui::INTERFACE_EVENT_CODE code;
} gui;