Dawn/src/display/renderlist.h
2021-09-19 20:50:35 -07:00

47 lines
1.1 KiB
C

/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "../libs.h"
#include "framebuffer.h"
#include "primitive.h"
#include "shader.h"
#include "camera.h"
#include "../engine/engine.h"
#include "primitives/quad.h"
#include "../util/dynarray.h"
typedef struct {
framebuffer_t frame;
shader_t *shader;
} renderpass_t;
typedef struct {
framebuffer_t frame;
primitive_t quad;
dynarray_t passes;
void *user;
} renderlist_t;
typedef void renderitemcallback_t(
renderlist_t *list, renderpass_t *pass, engine_t *engine, int32_t i
);
typedef struct {
renderitemcallback_t *onRender;
} renderitem_t;
void renderListInit(renderlist_t *list, int32_t passes, int32_t width, int32_t height);
renderpass_t * renderListGetPass(renderlist_t *list, int32_t pass);
int32_t renderPassAdd(renderlist_t *list);
void renderListRenderPass(
renderlist_t *list, engine_t *engine,
camera_t *camera, int32_t pass, dynarray_t *items
);
void renderListRender(renderlist_t *list, engine_t *engine, shader_t *shader);