Day 25 done.

This commit is contained in:
2026-03-25 14:33:23 -07:00
parent 64ccae4637
commit 4be3d0df80
5 changed files with 182 additions and 64 deletions
+20 -9
View File
@@ -7,16 +7,22 @@
/* NOTE: Servcies that the platform layer provides to the game. */
/* --------------------------------------------------------------------- */
typedef struct thread_context {
S32 Placeholder;
} thread_context;
#if BUILD_INTERNAL
typedef struct debug_read_file_result {
U32 ContentsSize;
void *Contents;
} debug_read_file_result;
debug_read_file_result DEBUGPlatformReadEntireFile(const char *Filename);
B32 DEBUGPlatformWriteEntireFile(const char *Filename, U32 MemorySize,
debug_read_file_result DEBUGPlatformReadEntireFile(thread_context *Thread,
const char *Filename);
B32 DEBUGPlatformWriteEntireFile(thread_context *Thread,
const char *Filename, U32 MemorySize,
void *Memory);
void DEBUGPlatformFreeFileMemory(void *Memory);
void DEBUGPlatformFreeFileMemory(thread_context *Thread, void *Memory);
#endif
/* --------------------------------------------------------------------- */
@@ -77,6 +83,9 @@ typedef struct game_controller_input {
} game_controller_input;
typedef struct game_input {
game_button_state MouseButtons[5];
S32 MouseX, MouseY, MouseZ; /* NOTE: MouseZ is the wheel. */
/* TODO: Insert clock value here . . . */
game_controller_input Controllers[5];
} game_input;
@@ -85,7 +94,7 @@ game_controller_input *GetController(game_input *Input, S32 ControllerIndex)
{
game_controller_input *Result;
Assert((U32)ControllerIndex < ARRAY_SIZE(Input->Controllers));
ASSERT((U32)ControllerIndex < ARRAY_SIZE(Input->Controllers));
Result = &(Input->Controllers[ControllerIndex]);
return Result;
}
@@ -104,9 +113,11 @@ typedef struct game_memory {
layer.) */
#if BUILD_INTERNAL
debug_read_file_result (*DEBUGPlatformReadEntireFile)(const char *);
B32 (*DEBUGPlatformWriteEntireFile)(const char *, U32, void *);
void (*DEBUGPlatformFreeFileMemory)(void *);
debug_read_file_result (*DEBUGPlatformReadEntireFile)(
thread_context *Thread,const char *);
B32 (*DEBUGPlatformWriteEntireFile)(thread_context *Thread,
const char *, U32, void *);
void (*DEBUGPlatformFreeFileMemory)(thread_context *Thread, void *);
#endif
} game_memory;
@@ -115,8 +126,8 @@ typedef struct game_memory {
F32 SecondsElapsed;
} game_clocks;*/
void UpdateAndRender(game_memory *Memory, game_input *Input,
game_offscreen_buffer *Buffer,
void UpdateAndRender(thread_context *Thread, game_memory *Memory,
game_input *Input, game_offscreen_buffer *Buffer,
game_sound_output_buffer *SoundBuffer);
/*