1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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
|