gameui

diff src/event.h @ 3:f1014234dece

transitions in gui elements are awesome :)
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 21 Mar 2014 03:37:16 +0200
parents
children e0916bb20b7f
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/event.h	Fri Mar 21 03:37:16 2014 +0200
     1.3 @@ -0,0 +1,45 @@
     1.4 +#ifndef EVENT_H_
     1.5 +#define EVENT_H_
     1.6 +
     1.7 +#include "vec.h"
     1.8 +
     1.9 +namespace gameui {
    1.10 +
    1.11 +enum EventType {
    1.12 +	EV_MOUSE_BUTTON,
    1.13 +	EV_MOUSE_MOTION,
    1.14 +	EV_MOUSE_FOCUS,
    1.15 +	EV_KEY
    1.16 +};
    1.17 +
    1.18 +struct ButtonEvent {
    1.19 +	Vec2 pos;
    1.20 +	int button;
    1.21 +	bool press;
    1.22 +};
    1.23 +
    1.24 +struct MotionEvent {
    1.25 +	Vec2 pos;
    1.26 +};
    1.27 +
    1.28 +struct FocusEvent {
    1.29 +	bool enter;
    1.30 +};
    1.31 +
    1.32 +struct KeyEvent {
    1.33 +	int key;
    1.34 +	bool press;
    1.35 +};
    1.36 +
    1.37 +struct Event {
    1.38 +	EventType type;
    1.39 +
    1.40 +	ButtonEvent button;
    1.41 +	MotionEvent motion;
    1.42 +	FocusEvent focus;
    1.43 +	KeyEvent key;
    1.44 +};
    1.45 +
    1.46 +}	// namespace gameui
    1.47 +
    1.48 +#endif	// EVENT_H_