From 818f818f583881156eb279c71b1359bf2c4f3580 Mon Sep 17 00:00:00 2001 From: pryazha Date: Sun, 12 Oct 2025 15:25:23 +0500 Subject: change identation, maybe will change back, add own gl functions loading, and glx example --- context.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 context.h (limited to 'context.h') diff --git a/context.h b/context.h new file mode 100644 index 0000000..70deb21 --- /dev/null +++ b/context.h @@ -0,0 +1,56 @@ +#ifndef ctx_h +#define ctx_h + +#include "input.h" +#include "window.h" + +#include "prbs.h" + +struct prge_context { + i32 stop; + struct arena pers; + struct arena temp; + struct input in; + i32 width, height; + /* + struct sound sounds[max_sounds_loaded]; + struct sound_node sound_nodes[max_sounds_playing]; + struct sound_queue queue; + */ + /* struct elist entities; */ + struct string basedir; +}; + +struct prge_context init_prge(i32 width, i32 height); + +/* + texture_t prge_load_texture(prge_context_t *ctx, const char *filename, i32 gamma) + { + char full_path[MAX_PATH]; + snprintf(full_path, sizeof(full_path), "%s/%s", ctx->dir, filename); + texture_t texture = load_texture(&ctx->arena, full_path, gamma); + return texture; + } + + model_t prge_load_model(prge_context_t *ctx, transform_t transform, const char *filename) + { + char full_path[MAX_PATH]; + snprintf(full_path, sizeof(full_path), "%s/%s", ctx->dir, filename); + model_t model = load_model_obj(&ctx->arena, transform, full_path); + return model; + } + + i32 prge_load_sound_vorbis(prge_context_t *ctx, const char *filename) + { + char full_path[MAX_PATH]; + snprintf(full_path, sizeof(full_path), "%s/%s", ctx->dir, filename); + return load_vorbis(&ctx->arena, ctx->sounds, full_path); + } + + void prge_play_sound(prge_context_t *ctx, i32 id) + { + play_sound(ctx->sounds, &ctx->sound_queue, ctx->sound_queue_nodes, id); + } + */ + +#endif -- cgit v1.2.3-70-g09d2