diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/CMakeLists.txt | 2 | ||||
-rw-r--r-- | app/demo/CMakeLists.txt | 15 | ||||
-rw-r--r-- | app/demo/main.c | 47 |
3 files changed, 64 insertions, 0 deletions
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 | |||
15 | glfw | 15 | glfw |
16 | log | 16 | log |
17 | timer) | 17 | timer) |
18 | |||
19 | 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 @@ | |||
1 | cmake_minimum_required(VERSION 3.0) | ||
2 | |||
3 | project(gfxappdemo) | ||
4 | |||
5 | set(CMAKE_C_STANDARD 17) | ||
6 | set(CMAKE_C_STANDARD_REQUIRED On) | ||
7 | set(CMAKE_C_EXTENSIONS Off) | ||
8 | |||
9 | add_executable(gfxappdemo | ||
10 | main.c) | ||
11 | |||
12 | target_link_libraries(gfxappdemo PRIVATE | ||
13 | gfx-app) | ||
14 | |||
15 | 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 @@ | |||
1 | #include <gfx/app.h> | ||
2 | |||
3 | #include <assert.h> | ||
4 | |||
5 | const int WIDTH = 960; | ||
6 | const int HEIGHT = 600; | ||
7 | const int MAX_FPS = 60; | ||
8 | const char* TITLE = "iso3d"; | ||
9 | |||
10 | typedef struct GfxAppState { | ||
11 | int unused; | ||
12 | } GfxAppState; | ||
13 | |||
14 | bool Init(GfxAppState* state, int argc, const char** argv) { | ||
15 | assert(state); | ||
16 | |||
17 | (void)argc; | ||
18 | (void)argv; | ||
19 | |||
20 | return true; | ||
21 | } | ||
22 | |||
23 | void Shutdown(GfxAppState* state) { | ||
24 | assert(state); | ||
25 | // | ||
26 | } | ||
27 | |||
28 | void Update(GfxAppState* state, double t, double dt) { | ||
29 | assert(state); | ||
30 | |||
31 | (void)t; | ||
32 | (void)dt; | ||
33 | } | ||
34 | |||
35 | void Render(GfxAppState* state) { | ||
36 | assert(state); | ||
37 | // | ||
38 | } | ||
39 | |||
40 | void Resize(GfxAppState* state, int width, int height) { | ||
41 | assert(state); | ||
42 | |||
43 | (void)width; | ||
44 | (void)height; | ||
45 | } | ||
46 | |||
47 | GFX_APP_MAIN(WIDTH, HEIGHT, MAX_FPS, TITLE) | ||