summaryrefslogtreecommitdiff
path: root/context.h
diff options
context:
space:
mode:
authorpryazha <pryadeiniv@mail.ru>2025-10-12 15:25:23 +0500
committerpryazha <pryadeiniv@mail.ru>2025-10-12 15:25:23 +0500
commit818f818f583881156eb279c71b1359bf2c4f3580 (patch)
tree874e8d2fdc5334bc70925aa87923791f7662ddb8 /context.h
parent3cf987880e384140bf996c37f820ddeea38bc60e (diff)
change identation, maybe will change back, add own gl functions loading, and glx example
Diffstat (limited to 'context.h')
-rw-r--r--context.h56
1 files changed, 56 insertions, 0 deletions
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