summaryrefslogtreecommitdiff
path: root/src/renderer/render.h
blob: 6cd9701c9893c52e63f08423b6ac81f62053ab8b (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
/**
 * @file render.h
 * @author your name (you@domain.com)
 * @brief Renderer frontend
 * @version 0.1
 * @date 2024-03-21
 *
 * @copyright Copyright (c) 2024
 *
 */
#pragma once

#include "camera.h"
#include "loaders.h"
#include "render_types.h"

// --- Lifecycle
/** @brief initialise the render system frontend */
bool renderer_init(renderer* ren);
/** @brief shutdown the render system frontend */
void renderer_shutdown(renderer* ren);

void renderer_on_resize(renderer* ren);

struct render_packet;

// --- Frame

void render_frame_begin(renderer* ren);
void render_frame_end(renderer* ren);
void render_frame_draw(renderer* ren);

// --- models meshes
void model_upload_meshes(renderer* ren, model* model);
void draw_model(renderer* ren, camera* camera, model* model, transform tf, scene* scene);
void draw_mesh(renderer* ren, mesh* mesh, transform tf, material* mat, mat4* view, mat4* proj);

// ---
texture texture_data_load(const char* path, bool invert_y);  // #frontend
void texture_data_upload(texture* tex);                      // #backend