43 lines
858 B
C
43 lines
858 B
C
#include "buffer.h"
|
|
|
|
void
|
|
buffer_draw(Renderer* renderer, Shader* shader, RendererBuffer buffer, Postprocessing* postprocessing)
|
|
{
|
|
mat4 model;
|
|
mat4 projection;
|
|
mat4 view;
|
|
vec2 size;
|
|
vec3 position;
|
|
Texture* texture;
|
|
|
|
glm_vec2_zero(size);
|
|
glm_vec3_zero(position);
|
|
glm_mat4_identity(model);
|
|
|
|
size[0] = renderer->bufferSizes[buffer][0];
|
|
size[1] = renderer->bufferSizes[buffer][1];
|
|
|
|
position[2] *= BUFFER_Z_INCREMENT;
|
|
|
|
glm_translate(model, position);
|
|
|
|
camera_projection_get(&renderer->camera[buffer], projection);
|
|
camera_view_get(&renderer->camera[buffer], view);
|
|
|
|
texture_quad_draw
|
|
(
|
|
&renderer->fboTextures[buffer],
|
|
renderer,
|
|
shader,
|
|
(f32*)TEXTURE_QUAD_UV_MIN_DEFAULT,
|
|
(f32*)TEXTURE_QUAD_UV_MAX_DEFAULT,
|
|
model,
|
|
view,
|
|
projection,
|
|
size,
|
|
postprocessing->color,
|
|
postprocessing->colorCover,
|
|
FLIP_HORIZONTAL_VERTICAL
|
|
);
|
|
}
|