19 lines
551 B
C
19 lines
551 B
C
|
#include <gear/graphics/renderer.h>
|
||
|
|
||
|
g_renderer g_renderer_create(g_color clear_color) {
|
||
|
g_renderer renderer;
|
||
|
memset(&renderer, 0, sizeof(g_renderer));
|
||
|
|
||
|
sg_color_attachment_action color_action = {
|
||
|
.load_action = SG_LOADACTION_CLEAR,
|
||
|
.clear_value = G_COLOR_TO_FLOAT_ARR(clear_color),
|
||
|
};
|
||
|
|
||
|
renderer.pass_action = (sg_pass_action){
|
||
|
.colors = { color_action, color_action, color_action, color_action },
|
||
|
.depth = { .load_action = SG_LOADACTION_CLEAR, .clear_value = 1.0f },
|
||
|
};
|
||
|
|
||
|
return renderer;
|
||
|
}
|