start on jtk module

This commit is contained in:
josh committed 2018-07-25 22:05:11 -04:00
1 parent e7acf05cc4
commit 5d6c6b0e0f
2 files changed
+54

No files matched your search

+1
View File
@@ -2,5 +2,6 @@ Rscons::Environment.new do |env|
env["sources"] = Dir[
"src/**/*.d",
"src/**/*.c"]
env["D_IMPORT_PATH"] += Dir["src/**/"]
env.Program("#{env.build_root}/jes", "${sources}")
end
+53
View File
@@ -0,0 +1,53 @@
struct Event
{
enum Type : ubyte
{
WINDOW_CLOSE,
WINDOW_EXPOSE,
KEY_PRESS,
KEY_RELEASE,
BUTTON_PRESS,
BUTTON_RELEASE,
TIMER,
WINDOW_RESIZE,
};
struct KeyEvent
{
bool repeat;
uint key;
uint x_keycode;
};
struct ButtonEvent
{
uint mods;
ubyte button;
};
struct TimerEvent
{
uint timer_id;
void * user1;
void * user2;
};
struct WindowResizeEvent
{
uint width;
uint height;
};
Type type;
union
{
KeyEvent key;
ButtonEvent button;
TimerEvent timer;
WindowResizeEvent resize;
};
}
class Window
{
}