2012-01-23 23:45:33 +00:00
|
|
|
#ifndef _PAYSAGES_RENDERER_H_
|
|
|
|
#define _PAYSAGES_RENDERER_H_
|
|
|
|
|
|
|
|
#include "shared/types.h"
|
2012-12-02 11:08:56 +00:00
|
|
|
#include "atmosphere/public.h"
|
2013-01-22 20:50:37 +00:00
|
|
|
#include "clouds/public.h"
|
2012-12-09 17:49:28 +00:00
|
|
|
#include "terrain/public.h"
|
2013-01-14 19:07:56 +00:00
|
|
|
#include "render.h"
|
2012-01-23 23:45:33 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct Renderer
|
|
|
|
{
|
2012-01-29 21:45:58 +00:00
|
|
|
/* Render base configuration */
|
2012-01-23 23:45:33 +00:00
|
|
|
int render_quality;
|
2012-01-29 21:45:58 +00:00
|
|
|
int render_width;
|
|
|
|
int render_height;
|
2012-01-31 11:20:52 +00:00
|
|
|
CameraDefinition render_camera;
|
2012-01-23 23:45:33 +00:00
|
|
|
|
2012-01-24 13:16:20 +00:00
|
|
|
/* Render related */
|
2012-01-29 21:45:58 +00:00
|
|
|
RenderArea* render_area;
|
2012-06-17 09:40:40 +00:00
|
|
|
double render_progress;
|
2012-01-29 21:45:58 +00:00
|
|
|
int render_interrupt;
|
|
|
|
int is_rendering;
|
2013-01-31 15:10:11 +00:00
|
|
|
Vector3 (*getCameraLocation)(Renderer* renderer, Vector3 target);
|
|
|
|
Vector3 (*getCameraDirection)(Renderer* renderer, Vector3 target);
|
2012-06-17 09:40:40 +00:00
|
|
|
double (*getPrecision)(Renderer* renderer, Vector3 location);
|
2012-01-24 13:16:20 +00:00
|
|
|
Vector3 (*projectPoint)(Renderer* renderer, Vector3 point);
|
|
|
|
Vector3 (*unprojectPoint)(Renderer* renderer, Vector3 point);
|
2012-06-17 09:40:40 +00:00
|
|
|
int (*addRenderProgress)(Renderer* renderer, double progress);
|
|
|
|
void (*pushTriangle)(Renderer* renderer, Vector3 v1, Vector3 v2, Vector3 v3, f_RenderFragmentCallback callback, void* callback_data);
|
|
|
|
void (*pushQuad)(Renderer* renderer, Vector3 v1, Vector3 v2, Vector3 v3, Vector3 v4, f_RenderFragmentCallback callback, void* callback_data);
|
2012-01-24 13:16:20 +00:00
|
|
|
|
2013-01-22 13:32:39 +00:00
|
|
|
/* Shortcuts */
|
|
|
|
Color (*applyLightingToSurface)(Renderer* renderer, Vector3 location, Vector3 normal, SurfaceMaterial* material);
|
2013-02-03 21:18:32 +00:00
|
|
|
Color (*applyMediumTraversal)(Renderer* renderer, Vector3 location, Color color);
|
2013-01-22 13:32:39 +00:00
|
|
|
|
2012-01-24 13:16:20 +00:00
|
|
|
/* Scenery related */
|
|
|
|
RayCastingResult (*rayWalking)(Renderer* renderer, Vector3 location, Vector3 direction, int terrain, int water, int sky, int clouds);
|
2012-01-29 17:53:12 +00:00
|
|
|
HeightInfo (*getWaterHeightInfo)(Renderer* renderer);
|
2012-06-17 09:40:40 +00:00
|
|
|
Color (*applyTextures)(Renderer* renderer, Vector3 location, double precision);
|
2012-01-24 13:16:20 +00:00
|
|
|
|
2013-01-19 22:42:50 +00:00
|
|
|
/* Autonomous tools */
|
|
|
|
LightingManager* lighting;
|
2012-12-02 11:08:56 +00:00
|
|
|
|
2012-11-25 21:53:01 +00:00
|
|
|
/* Autonomous sub-renderers */
|
|
|
|
AtmosphereRenderer* atmosphere;
|
2012-12-09 17:49:28 +00:00
|
|
|
TerrainRenderer* terrain;
|
2013-01-22 20:50:37 +00:00
|
|
|
CloudsRenderer* clouds;
|
2012-01-23 23:45:33 +00:00
|
|
|
|
|
|
|
/* Custom data */
|
|
|
|
void* customData[10];
|
|
|
|
};
|
|
|
|
|
2013-01-20 15:07:45 +00:00
|
|
|
Renderer* rendererCreate();
|
2012-01-29 21:45:58 +00:00
|
|
|
void rendererDelete(Renderer* renderer);
|
|
|
|
void rendererSetPreviewCallbacks(Renderer* renderer, RenderCallbackStart start, RenderCallbackDraw draw, RenderCallbackUpdate update);
|
2012-06-13 15:38:11 +00:00
|
|
|
void rendererStart(Renderer* renderer, RenderParams params);
|
2012-01-29 21:45:58 +00:00
|
|
|
void rendererInterrupt(Renderer* renderer);
|
2012-01-23 23:45:33 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|