blob: 9ba741bbba2cc3ae449eb3adc0404cc024f4928e (
plain)
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
57
58
59
60
61
62
63
64
65
|
/**
* @file celeritas.h
* @author your name (you@domain.com)
* @brief
* @version 0.1
* @date 2024-05-09
*
* @copyright Copyright (c) 2024
*
*/
/* The Goal of this file is to test ocaml-bindgen on it to start moving development over into OCaml */
#include <stdbool.h>
#include <stdint.h>
// Forward Declarations
typedef struct core core;
// Handles
typedef uint32_t model_handle;
// Maths
typedef struct vec2 { float x, y; } vec2;
typedef struct vec3 { float x, y, z; } vec3;
typedef struct vec4 { float x, y, z, w; } vec4;
typedef struct mat4 { float data[16]; } mat4;
typedef struct transform3d { vec3 translation; vec4 rotation; float scale; } transform3d;
// Lifecycle functions
void core_bringup();
void core_shutdown();
bool should_window_close();
void frame_begin();
void frame_draw();
void frame_end();
// Assets
model_handle model_load(const char* filepath);
// Rendering
typedef struct render_entity {
model_handle model;
// TODO: material
transform3d transform;
} render_entity;
void render_frame_begin();
// Scene
typedef struct directional_light {} directional_light;
typedef struct point_light {} point_light;
void scene_add_dir_light(directional_light light);
void scene_add_point_light(directional_light light);
void scene_add_model(model_handle model, transform3d transform);
bool scene_remove_model(model_handle model);
void scene_set_model_transform(model_handle model, transform3d new_transform);
void scene_set_camera(vec3 pos, vec3 front);
// Immediate mode drawing
// Input
|