From 6347ee483182bf8c5d139d1110ce2c335af60e4f Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Wed, 28 Aug 2024 09:42:03 -0700 Subject: Add demo skeleton. --- app/CMakeLists.txt | 2 ++ app/demo/CMakeLists.txt | 15 +++++++++++++++ app/demo/main.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 app/demo/CMakeLists.txt create mode 100644 app/demo/main.c (limited to 'app') diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 4db314d..7703ccb 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -15,3 +15,5 @@ target_link_libraries(gfx-app PUBLIC glfw log timer) + +add_subdirectory(demo) diff --git a/app/demo/CMakeLists.txt b/app/demo/CMakeLists.txt new file mode 100644 index 0000000..bbb3aae --- /dev/null +++ b/app/demo/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.0) + +project(gfxappdemo) + +set(CMAKE_C_STANDARD 17) +set(CMAKE_C_STANDARD_REQUIRED On) +set(CMAKE_C_EXTENSIONS Off) + +add_executable(gfxappdemo + main.c) + +target_link_libraries(gfxappdemo PRIVATE + gfx-app) + +target_compile_options(gfxappdemo PRIVATE -Wall -Wextra -Wpedantic) diff --git a/app/demo/main.c b/app/demo/main.c new file mode 100644 index 0000000..0b83711 --- /dev/null +++ b/app/demo/main.c @@ -0,0 +1,47 @@ +#include + +#include + +const int WIDTH = 960; +const int HEIGHT = 600; +const int MAX_FPS = 60; +const char* TITLE = "iso3d"; + +typedef struct GfxAppState { + int unused; +} GfxAppState; + +bool Init(GfxAppState* state, int argc, const char** argv) { + assert(state); + + (void)argc; + (void)argv; + + return true; +} + +void Shutdown(GfxAppState* state) { + assert(state); + // +} + +void Update(GfxAppState* state, double t, double dt) { + assert(state); + + (void)t; + (void)dt; +} + +void Render(GfxAppState* state) { + assert(state); + // +} + +void Resize(GfxAppState* state, int width, int height) { + assert(state); + + (void)width; + (void)height; +} + +GFX_APP_MAIN(WIDTH, HEIGHT, MAX_FPS, TITLE) -- cgit v1.2.3