Add basic input system
This commit is contained in:
@@ -19,7 +19,7 @@ typedef struct InputState {
|
||||
MouseButton RMB;
|
||||
MouseButton MMB;
|
||||
KeyboardKey ESC;
|
||||
f32 DRAG_LIMIT;
|
||||
f32 CLICK_LIMIT;
|
||||
// Common
|
||||
Vector2 mouseDown;
|
||||
Vector2 mouseDownWorld;
|
||||
@@ -30,7 +30,8 @@ typedef struct InputState {
|
||||
TilePosition buildingPos;
|
||||
TileSize buildingSize;
|
||||
// SELECTED_UNITS
|
||||
// SELECTED_OBJECTS
|
||||
ecs_entity_t *entities;
|
||||
// SELECTED_OBJECT
|
||||
// SELECTED_BUILDING
|
||||
} InputState;
|
||||
|
||||
@@ -43,7 +44,6 @@ typedef struct Game {
|
||||
BzSpatialGrid *entityGrid;
|
||||
f32 frameDuration;
|
||||
ecs_entity_t entity;
|
||||
InputState input;
|
||||
struct {
|
||||
i64 wood;
|
||||
i64 iron;
|
||||
@@ -66,5 +66,6 @@ typedef struct Game {
|
||||
extern ecs_world_t *ECS;
|
||||
|
||||
extern ECS_COMPONENT_DECLARE(Game);
|
||||
extern ECS_COMPONENT_DECLARE(InputState);
|
||||
|
||||
#endif //PIXELDEFENSE_GAME_STATE_H
|
||||
|
||||
Reference in New Issue
Block a user