From 32bed038d8cd79adf41c812829a9d9d4812f46f4 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 8 Nov 2023 20:33:39 +0100 Subject: Updated open-graph --- examples/core/core_storage_values.html | 207 ++++++++++++++++++++++++++++++++- 1 file changed, 206 insertions(+), 1 deletion(-) (limited to 'examples/core/core_storage_values.html') diff --git a/examples/core/core_storage_values.html b/examples/core/core_storage_values.html index f02a7d5..85a144c 100644 --- a/examples/core/core_storage_values.html +++ b/examples/core/core_storage_values.html @@ -1 +1,206 @@ -raylib web game
\ No newline at end of file +core storage values // Required for: calloc(), free() + +#define STORAGE_DATA_FILE "storage.data" // Storage file + +// NOTE: Storage positions must start with 0, directly related to file memory layout +typedef enum { + STORAGE_POSITION_SCORE = 0, + STORAGE_POSITION_HISCORE = 1 +} StorageData; + +// Persistent storage functions +static bool SaveStorageValue(unsigned int position, int value); +static int LoadStorageValue(unsigned int position); + +//------------------------------------------------------------------------------------ +// Program main entry point +//------------------------------------------------------------------------------------ +int main(void) +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + + InitWindow(screenWidth, screenHeight, "raylib [core] example - storage save/load values"); + + int score = 0; + int hiscore = 0; + int framesCounter = "name=description> // Required for: calloc(), free() + +#define STORAGE_DATA_FILE "storage.data" // Storage file + +// NOTE: Storage positions must start with 0, directly related to file memory layout +typedef enum { + STORAGE_POSITION_SCORE = 0, + STORAGE_POSITION_HISCORE = 1 +} StorageData; + +// Persistent storage functions +static bool SaveStorageValue(unsigned int position, int value); +static int LoadStorageValue(unsigned int position); + +//------------------------------------------------------------------------------------ +// Program main entry point +//------------------------------------------------------------------------------------ +int main(void) +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + + InitWindow(screenWidth, screenHeight, "raylib [core] example - storage save/load values"); + + int score = 0; + int hiscore = 0; + int framesCounter = "property=og:image:alt> // Required for: calloc(), free() + +#define STORAGE_DATA_FILE "storage.data" // Storage file + +// NOTE: Storage positions must start with 0, directly related to file memory layout +typedef enum { + STORAGE_POSITION_SCORE = 0, + STORAGE_POSITION_HISCORE = 1 +} StorageData; + +// Persistent storage functions +static bool SaveStorageValue(unsigned int position, int value); +static int LoadStorageValue(unsigned int position); + +//------------------------------------------------------------------------------------ +// Program main entry point +//------------------------------------------------------------------------------------ +int main(void) +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + + InitWindow(screenWidth, screenHeight, "raylib [core] example - storage save/load values"); + + int score = 0; + int hiscore = 0; + int framesCounter = "property=og:description> // Required for: calloc(), free() + +#define STORAGE_DATA_FILE "storage.data" // Storage file + +// NOTE: Storage positions must start with 0, directly related to file memory layout +typedef enum { + STORAGE_POSITION_SCORE = 0, + STORAGE_POSITION_HISCORE = 1 +} StorageData; + +// Persistent storage functions +static bool SaveStorageValue(unsigned int position, int value); +static int LoadStorageValue(unsigned int position); + +//------------------------------------------------------------------------------------ +// Program main entry point +//------------------------------------------------------------------------------------ +int main(void) +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + + InitWindow(screenWidth, screenHeight, "raylib [core] example - storage save/load values"); + + int score = 0; + int hiscore = 0; + int framesCounter = "name=twitter:image:alt> // Required for: calloc(), free() + +#define STORAGE_DATA_FILE "storage.data" // Storage file + +// NOTE: Storage positions must start with 0, directly related to file memory layout +typedef enum { + STORAGE_POSITION_SCORE = 0, + STORAGE_POSITION_HISCORE = 1 +} StorageData; + +// Persistent storage functions +static bool SaveStorageValue(unsigned int position, int value); +static int LoadStorageValue(unsigned int position); + +//------------------------------------------------------------------------------------ +// Program main entry point +//------------------------------------------------------------------------------------ +int main(void) +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + + InitWindow(screenWidth, screenHeight, "raylib [core] example - storage save/load values"); + + int score = 0; + int hiscore = 0; + int framesCounter = "name=twitter:description>
\ No newline at end of file -- cgit v1.2.3