Game code is now loaded dynamically.
This commit is contained in:
+11
-4
@@ -1,6 +1,9 @@
|
||||
#ifndef HANDMADE_H
|
||||
#define HANDMADE_H
|
||||
|
||||
#include "sdl_handmade.h"
|
||||
#include "core.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// NOTE: Servcies that the platform layer provides to the game. //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -13,9 +16,9 @@ typedef struct debug_read_file_result {
|
||||
void *Contents;
|
||||
} debug_read_file_result;
|
||||
|
||||
static debug_read_file_result DEBUGPlatformReadEntireFile(const char *Filename);
|
||||
static B32 DEBUGPlatformWriteEntireFile(const char *Filename, U32 MemorySize, void *Memory);
|
||||
static void DEBUGPlatformFreeFileMemory(void *Memory);
|
||||
debug_read_file_result DEBUGPlatformReadEntireFile(const char *Filename);
|
||||
B32 DEBUGPlatformWriteEntireFile(const char *Filename, U32 MemorySize, void *Memory);
|
||||
void DEBUGPlatformFreeFileMemory(void *Memory);
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -94,6 +97,10 @@ typedef struct game_memory {
|
||||
|
||||
U64 TransientStorageSize;
|
||||
void *TransientStorage; // WARNING: This memory is REQUIRED to be zero initialized!!! (Done by the OS layer.)
|
||||
|
||||
debug_read_file_result (*DEBUGPlatformReadEntireFile)(const char *);
|
||||
B32 (*DEBUGPlatformWriteEntireFile)(const char *, U32, void *);
|
||||
void (*DEBUGPlatformFreeFileMemory)(void *);
|
||||
} game_memory;
|
||||
|
||||
// typedef struct game_clocks {
|
||||
@@ -101,7 +108,7 @@ typedef struct game_memory {
|
||||
// F32 SecondsElapsed;
|
||||
// } game_clocks;
|
||||
|
||||
static void GameUpdateAndRender(game_memory *Memory, game_input *Input, game_offscreen_buffer *Buffer, game_sound_output_buffer *SoundBuffer);
|
||||
extern "C" void UpdateAndRender(game_memory *Memory, game_input *Input, game_offscreen_buffer *Buffer, game_sound_output_buffer *SoundBuffer);
|
||||
|
||||
//
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user