diff options
author | omnisci3nce <17525998+omnisci3nce@users.noreply.github.com> | 2024-04-04 20:25:40 +1100 |
---|---|---|
committer | omnisci3nce <17525998+omnisci3nce@users.noreply.github.com> | 2024-04-04 20:25:40 +1100 |
commit | bb889d2edc1cc72b939edf47a2e03b7569c1a722 (patch) | |
tree | 59b7744d44bda7768ba908224a18d6a5046b186f /src/renderer/render_backend.h | |
parent | 1047d08258f6c56f5fa8067cc65694b1b5798602 (diff) | |
parent | 6a95b047998c0e0dcfdf60d17cf2cd0bd0bfee12 (diff) |
Merge branch 'cel-60-scaffold-vulkan' into cel-67-load-animation-data-from-gltf
Diffstat (limited to 'src/renderer/render_backend.h')
-rw-r--r-- | src/renderer/render_backend.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/renderer/render_backend.h b/src/renderer/render_backend.h index 7e1c16c..da30bcc 100644 --- a/src/renderer/render_backend.h +++ b/src/renderer/render_backend.h @@ -1,17 +1,25 @@ /** - * @brief + * @brief Renderer backend */ #pragma once +#include "camera.h" #include "maths_types.h" #include "render_types.h" /// --- Lifecycle + +/** @brief Initialise the graphics API backend */ bool gfx_backend_init(renderer* ren); void gfx_backend_shutdown(renderer* ren); +void gfx_backend_draw_frame(renderer* ren, camera* camera, mat4 model, texture* tex); +void gfx_backend_update_global_state(mat4 projection, mat4 view, vec3 view_pos, vec4 ambient_colour, + i32 mode); + void clear_screen(vec3 colour); +void texture_data_upload(texture* tex); void bind_texture(shader s, texture* tex, u32 slot); void bind_mesh_vertex_buffer(void* backend, mesh* mesh); void draw_primitives(cel_primitive_topology primitive, u32 start_index, u32 count); @@ -20,3 +28,12 @@ shader shader_create_separate(const char* vert_shader, const char* frag_shader); void set_shader(shader s); // --- Uniforms + +/** @brief upload a vec3 of f32 to a uniform */ +void uniform_vec3f(u32 program_id, const char* uniform_name, vec3* value); +/** @brief upload a single f32 to a uniform */ +void uniform_f32(u32 program_id, const char* uniform_name, f32 value); +/** @brief upload a integer to a uniform */ +void uniform_i32(u32 program_id, const char* uniform_name, i32 value); +/** @brief upload a mat4 of f32 to a uniform */ +void uniform_mat4f(u32 program_id, const char* uniform_name, mat4* value);
\ No newline at end of file |