diff options
author | Joshua Rowe <17525998+omnisci3nce@users.noreply.github.com> | 2024-05-20 10:50:11 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-20 10:50:11 +1000 |
commit | e904c22003c3a134201b222e6619e782fbe63947 (patch) | |
tree | 5295c8ce5f855ca4a0f1bebe50beee80bae66682 /scratchpad.md | |
parent | 02e84ee4d18e705e3362be1e327fdb6f1397a032 (diff) | |
parent | 73d4145f46d2305f45761b8e456df692d1962dfb (diff) |
Merge pull request #14 from omnisci3nce/realign
Realign
Diffstat (limited to 'scratchpad.md')
-rw-r--r-- | scratchpad.md | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/scratchpad.md b/scratchpad.md deleted file mode 100644 index 19ad8b4..0000000 --- a/scratchpad.md +++ /dev/null @@ -1,71 +0,0 @@ - -```c -// engine.h -#pragma once - -#include <celstd.h> -#include <renderer.h> -#include <renderer_types.h> -#include <maths_types.h> -#include "threadpool.h" - -typedef struct frame_stats {} frame_stats; - -typedef struct engine_stats { - frame_stats frame; -} engine_stats; - -typedef struct engine { - // timing - float startTime; - float deltaTime; // time between current frame and last frame - float lastFrame; - // stats - engine_stats stats; -} engine; - -static bool engine_init(engine *engine) { - engine->startTime = glfwGetTime(); - engine->deltaTime = 0.0f; - engine->lastFrame = 0.0f; - - return true; -} - -static inline void engine_tick_start(engine *engine) { - float currentFrame = glfwGetTime(); - engine->deltaTime = currentFrame - engine->lastFrame; - engine->lastFrame = currentFrame; -} - -static inline void engine_tick_end(engine *engine) { - // TODO: clear frame stats -} - -void celeritas_print_type_sizes(); -``` - -```c -// engine.c -#include "engine.h" - -#include <stdio.h> - -#include "animation.h" -#include "application.h" - -void celeritas_print_type_sizes() { - printf("\e[1mType sizes: \e[m \n"); - printf("transform: %ld bytes\n", sizeof(transform)); - printf("mesh: %ld bytes\n", sizeof(mesh)); - printf("bh_material: %ld bytes\n", sizeof(bh_material)); - printf("animation: %ld bytes\n", sizeof(animation_clip)); - printf("model: %ld bytes\n", sizeof(model)); - printf("rend_buffer: %ld bytes\n", sizeof(rend_buffer)); - - printf("application: %ld bytes\n", sizeof(cel_application)); - printf("renderer: %ld bytes\n", sizeof(renderer)); - printf("threadpool: %ld bytes\n", sizeof(threadpool)); - printf("engine: %ld bytes\n", sizeof(engine)); -} -```
\ No newline at end of file |