diff options
author | Raymaekers Luca <luca@spacehb.net> | 2025-07-09 15:59:10 +0200 |
---|---|---|
committer | Raymaekers Luca <luca@spacehb.net> | 2025-07-09 15:59:10 +0200 |
commit | 71baed6f2ceb93ee8b3830b3049ad9487e5de234 (patch) | |
tree | 51ebfc6f3775ba82d8f8fc8f76ae536227522a65 /code/handmade_platform.h | |
parent | dd028b12f6cf44c20ecc57049eeac8fae52cd8e6 (diff) |
checkpoint
Diffstat (limited to 'code/handmade_platform.h')
-rw-r--r-- | code/handmade_platform.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/code/handmade_platform.h b/code/handmade_platform.h index 8831767..64716a7 100644 --- a/code/handmade_platform.h +++ b/code/handmade_platform.h @@ -128,10 +128,10 @@ extern "C" { { // NOTE(casey): Pixels are alwasy 32-bits wide, Memory Order BB GG RR XX void *Memory; - int Width; - int Height; - int Pitch; - int BytesPerPixel; + s32 Width; + s32 Height; + s32 Pitch; + s32 BytesPerPixel; } game_offscreen_buffer; typedef struct game_sound_output_buffer @@ -182,6 +182,14 @@ extern "C" { }; } game_controller_input; + typedef enum + { + PlatformMouseButton_Left = 0, + PlatformMouseButton_Right, + PlatformMouseButton_Middle, + PlatformMouseButton_Count + } platform_mouse_buttons; + typedef struct game_input { game_button_state MouseButtons[5]; @@ -192,6 +200,13 @@ extern "C" { game_controller_input Controllers[5]; } game_input; + inline b32 WasPressed(game_button_state State) + { + b32 Result = ((State.HalfTransitionCount > 1) || + (State.HalfTransitionCount == 1 && State.EndedDown)); + return Result; + } + typedef struct game_memory { b32 IsInitialized; |