2012-01-24 13:16:20 +00:00
|
|
|
#ifndef _PAYSAGES_RENDER_H_
|
|
|
|
#define _PAYSAGES_RENDER_H_
|
|
|
|
|
|
|
|
#include "shared/types.h"
|
2013-01-19 22:42:50 +00:00
|
|
|
#include "tools/color.h"
|
|
|
|
#include "tools/euclid.h"
|
2012-01-24 13:16:20 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2013-01-14 19:07:56 +00:00
|
|
|
|
2013-01-19 22:42:50 +00:00
|
|
|
typedef Color (*f_RenderFragmentCallback)(struct Renderer* renderer, Vector3 location, void* data);
|
|
|
|
|
2013-01-14 19:07:56 +00:00
|
|
|
typedef void (*RenderCallbackStart)(int width, int height, Color background);
|
|
|
|
typedef void (*RenderCallbackDraw)(int x, int y, Color col);
|
|
|
|
typedef void (*RenderCallbackUpdate)(double progress);
|
|
|
|
|
|
|
|
typedef struct RenderArea RenderArea;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
int antialias;
|
|
|
|
int quality;
|
|
|
|
} RenderParams;
|
|
|
|
|
2012-01-24 13:16:20 +00:00
|
|
|
void renderInit();
|
2012-02-12 16:57:29 +00:00
|
|
|
void renderQuit();
|
|
|
|
|
2012-01-29 21:45:58 +00:00
|
|
|
RenderArea* renderCreateArea();
|
|
|
|
void renderDeleteArea(RenderArea* area);
|
|
|
|
|
2012-06-13 15:38:11 +00:00
|
|
|
void renderSetParams(RenderArea* area, RenderParams params);
|
2012-01-29 21:45:58 +00:00
|
|
|
void renderSetBackgroundColor(RenderArea* area, Color* col);
|
|
|
|
void renderClear(RenderArea* area);
|
|
|
|
void renderUpdate(RenderArea* area);
|
|
|
|
|
2012-06-17 09:40:40 +00:00
|
|
|
void renderPushTriangle(RenderArea* area, Vector3 pixel1, Vector3 pixel2, Vector3 pixel3, Vector3 location1, Vector3 location2, Vector3 location3, f_RenderFragmentCallback callback, void* callback_data);
|
2012-01-29 21:45:58 +00:00
|
|
|
|
|
|
|
void renderPostProcess(RenderArea* area, Renderer* renderer, int nbchunks);
|
2012-05-06 10:13:34 +00:00
|
|
|
int renderSaveToFile(RenderArea* area, const char* path);
|
2012-01-29 21:45:58 +00:00
|
|
|
void renderSetPreviewCallbacks(RenderArea* area, RenderCallbackStart start, RenderCallbackDraw draw, RenderCallbackUpdate update);
|
2012-01-24 13:16:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|