rbdlsim/src/srender.h

55 lines
970 B
C
Raw Normal View History

2020-10-17 22:09:41 +02:00
#ifndef SRENDER_H
#define SRENDER_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct srndr srndr;
typedef struct srview srview;
typedef struct srcmdbuf srcmdbuf;
typedef enum {
SRndrCmdTypeGrid = 0,
SRndrCmdTypeBox,
SRndrCmdTypeLight,
SRndrCmdTypeSphere
} SRndrCmdType;
typedef struct srcmd {
float mat[16];
float color[4];
SRndrCmdType cmd_type;
} srcmd;
//
// Renderer
//
srndr* srndr_create();
void srndr_destroy(srndr* sr);
//
// View
//
srview* srview_create();
void srview_destroy(srview* sv);
void srview_set_proj(srview* sv, float* proj);
void srview_set_view(srview* sv, float* view);
void srview_set_size(srview* sv, int width, int height);
void srview_get_output_texture(srview* sv, GLuint* texture);
//
// Command Buffer and Commands
//
srcmdbuf* srcmdbuf_create(unsigned int size_max);
srcmd* srcmd_create(srcmdbuf* cmdbuf);
void srndr_render(srndr* srndr, srview* sview, srcmdbuf* scmdbuf);
#ifdef __cplusplus
}
#endif
#endif