1#ifndef __H__SETUP_CLIENT__
2#define __H__SETUP_CLIENT__
4#include "../engine/world.h"
6#include "../engine/input.h"
9#include "../rendering/context.h"
10#include "../rendering/image.h"
11#include "../rendering/quads.h"
12#include "../rendering/shader.h"
13#include "../systems/camera.h"
14#include "../systems/construct.h"
15#include "../systems/input.h"
16#include "../systems/physics.h"
17#include "../systems/require.h"
18#include "../systems/scheduler.h"
41 allocator_free(data->
alloc, file_buffer);
73 .phase = SYSTEM_PHASE_POST_UPDATE,
74 .world = (world_t *)1,
81 .phase = SYSTEM_PHASE_PRE_RENDER,
82 .world = (world_t *)1,
91 .phase = SYSTEM_PHASE_PRE_RENDER,
92 .world = (world_t *)1,
93 .input = (input_t *)1,
96 name_t deps_proj[] = {system_camera_move_name};
97 scheduler_declare_system(
99 camera_set_projection, deps_proj, 1,
101 .phase = SYSTEM_PHASE_PRE_RENDER,
102 .system_specific_data = &data->assets.tileset_shader,
103 .world = (world_t *)1,
104 .input = (input_t *)1,
105 .rendering_ctx = (rendering_ctx_t *)1,
115 name_t deps_render_constructs[] = {system_camera_move_name};
118 deps_render_constructs, 1,
120 .phase = SYSTEM_PHASE_RENDER,
121 .system_specific_data = render_constructs_data,
122 .world = (world_t *)1,
123 .input = (input_t *)1,
124 .rendering_ctx = (rendering_ctx_t *)1,
131 .phase = SYSTEM_PHASE_PRE_UPDATE,
132 .input = (input_t *)1,
133 .rendering_ctx = (rendering_ctx_t *)1,
147 FILE *f = fopen(
"./schedule.tmp.graphviz",
"w+");
static void client_schedule_systems(client_data_t *data)
Definition client.h:137
static void client_data__load_assets(client_data_t *data)
Definition client.h:35
static void client__schedule_physics(client_data_t *data)
Definition client.h:68
static void client_data_init(client_data_t *data, allocator_t alloc)
Definition client.h:50
static void client__schedule_rendering(client_data_t *data)
Definition client.h:86
static void rendering_ctx_show_window(rendering_ctx_t *ctx)
Definition context.h:51
static void rendering_ctx_init(rendering_ctx_t *ctx)
Definition context.h:30
size_t sz
Definition defs.h:51
@ ENTITY_KIND_CONSTRUCT
Definition entity.h:37
@ ENTITY_KIND_MASK_EMPTY
Definition entity.h:35
@ ENTITY_KIND_CAMERA
Definition entity.h:38
static void image_bind(image_t *image)
Definition image.h:51
static void * read_binary_file(allocator_t allocator, const char *filename, sz *size)
Read a binary file file of into memory.
Definition misc.h:9
static char * read_text_file(allocator_t allocator, const char *filename)
Definition misc.h:28
static void names_init()
Definition names.h:21
u64 name_t
Definition names.h:14
static GLuint _gl_quad_vao
Definition quads.h:6
static void gl_quad_init()
Definition quads.h:8
static system_req_t system_req_new()
Definition require.h:71
#define SYSTEM_REQ_NO_DEPS
Definition require.h:49
static void scheduler_dump_dependency_graph(scheduler_t *scheduler, FILE *out)
Definition scheduler.h:96
@ SCHEDULER_STRATEGY_RANDOM
Definition scheduler.h:14
static void scheduler_set_requirements(scheduler_t *scheduler, system_req_t reqs)
Definition scheduler.h:191
static scheduler_t scheduler_new(scheduler_strategy_t strategy, allocator_t persistent_allocator, allocator_t temporary_allocator)
Definition scheduler.h:36
static void scheduler_plan(scheduler_t *scheduler)
Definition scheduler.h:184
A generic allocator type passed by value. Contains a fallback allocator and a set of function pointer...
Definition memory.h:30
world_t world
Definition client.h:27
scheduler_t scheduler
Definition client.h:30
input_t input
Definition client.h:29
allocator_t alloc
Definition client.h:26
rendering_ctx_t rendering_ctx
Definition client.h:28
global_assets_t assets
Definition client.h:32
image_t tileset_image
Definition client.h:22
shader_t tileset_shader
Definition client.h:21
The raw data of an image.
Definition image.h:10
Definition construct.h:11
GLuint program
Definition construct.h:12
GLuint vao
Definition construct.h:13
image_t * image
Definition construct.h:14
Definition scheduler.h:22
allocator_t persistent_allocator
Definition scheduler.h:23
Small container and wrapper over OpenGL for shader-related things. In actually it is closer to what O...
Definition shader.h:15
GLuint gl_program
Definition shader.h:16
input_t * input
Definition require.h:62
rendering_ctx_t * rendering_ctx
Definition require.h:63
world_t * world
Definition require.h:61
static void world_init(world_t *world)
Definition world.h:18