2020-10-17 22:09:41 +02:00
|
|
|
#ifndef SRENDER_H
|
|
|
|
#define SRENDER_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2020-10-17 23:20:38 +02:00
|
|
|
#include "vectorial/simd4x4f.h"
|
|
|
|
|
2020-10-17 22:09:41 +02:00
|
|
|
typedef struct srndr srndr;
|
|
|
|
typedef struct srview srview;
|
|
|
|
typedef struct srcmdbuf srcmdbuf;
|
|
|
|
|
|
|
|
typedef enum {
|
2020-10-17 23:20:38 +02:00
|
|
|
SRndrCmdTypeFrame = 0,
|
|
|
|
SRndrCmdTypeGrid,
|
2020-10-17 22:09:41 +02:00
|
|
|
SRndrCmdTypeBox,
|
|
|
|
SRndrCmdTypeLight,
|
|
|
|
SRndrCmdTypeSphere
|
|
|
|
} SRndrCmdType;
|
|
|
|
|
|
|
|
typedef struct srcmd {
|
2020-10-17 23:20:38 +02:00
|
|
|
simd4x4f mat;
|
|
|
|
simd4f color;
|
|
|
|
SRndrCmdType type;
|
2020-10-17 22:09:41 +02:00
|
|
|
} srcmd;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Renderer
|
|
|
|
//
|
|
|
|
srndr* srndr_create();
|
|
|
|
void srndr_destroy(srndr* sr);
|
|
|
|
|
|
|
|
//
|
|
|
|
// View
|
|
|
|
//
|
|
|
|
srview* srview_create();
|
|
|
|
void srview_destroy(srview* sv);
|
|
|
|
|
2020-10-17 23:20:38 +02:00
|
|
|
void srview_set_proj(srview* sv, simd4x4f proj);
|
|
|
|
void srview_set_view(srview* sv, simd4x4f view);
|
2020-10-17 22:09:41 +02:00
|
|
|
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);
|
2020-10-17 23:20:38 +02:00
|
|
|
void srcmdbuf_clear (srcmdbuf* cmdbuf);
|
2020-10-17 22:09:41 +02:00
|
|
|
srcmd* srcmd_create(srcmdbuf* cmdbuf);
|
|
|
|
|
|
|
|
void srndr_render(srndr* srndr, srview* sview, srcmdbuf* scmdbuf);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|