2011-12-10 13:25:22 +00:00
|
|
|
#ifndef _PAYSAGES_TYPES_H_
|
|
|
|
#define _PAYSAGES_TYPES_H_
|
|
|
|
|
2012-05-29 13:32:23 +00:00
|
|
|
#include "../euclid.h"
|
|
|
|
#include "../color.h"
|
2012-01-29 17:39:56 +00:00
|
|
|
|
2011-12-23 22:58:50 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2011-12-10 13:25:22 +00:00
|
|
|
struct RenderFragment;
|
2012-01-24 13:16:20 +00:00
|
|
|
struct Renderer;
|
2011-12-10 13:25:22 +00:00
|
|
|
|
2012-06-05 20:22:12 +00:00
|
|
|
typedef struct LightDefinition LightDefinition;
|
|
|
|
typedef struct LightStatus LightStatus;
|
|
|
|
|
2012-01-24 13:16:20 +00:00
|
|
|
typedef int(*f_RenderFragmentCallback)(struct RenderFragment*, struct Renderer* renderer, void* data);
|
2011-12-10 13:25:22 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
Vector3 location;
|
|
|
|
Vector3 normal;
|
|
|
|
Color color;
|
|
|
|
f_RenderFragmentCallback callback;
|
2012-01-24 13:16:20 +00:00
|
|
|
void* callback_data;
|
2011-12-10 13:25:22 +00:00
|
|
|
} Vertex;
|
|
|
|
|
|
|
|
typedef struct RenderFragment
|
|
|
|
{
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
double z;
|
|
|
|
Vertex vertex;
|
|
|
|
} RenderFragment;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
} RenderContext;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int length;
|
|
|
|
int alloc_length;
|
|
|
|
int item_size;
|
|
|
|
int dirty;
|
|
|
|
void* data;
|
|
|
|
} Array;
|
|
|
|
|
2012-01-24 13:16:20 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
Color base;
|
|
|
|
double reflection;
|
|
|
|
double shininess;
|
|
|
|
} SurfaceMaterial;
|
|
|
|
|
2012-01-29 21:45:58 +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;
|
2011-12-10 13:25:22 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int hit;
|
|
|
|
Color hit_color;
|
|
|
|
Vector3 hit_location;
|
|
|
|
} RayCastingResult;
|
|
|
|
typedef RayCastingResult (*RayCastingFunction)(Vector3 start, Vector3 direction);
|
|
|
|
|
2012-01-29 17:53:12 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
double min_height;
|
|
|
|
double max_height;
|
|
|
|
double base_height;
|
|
|
|
} HeightInfo;
|
|
|
|
|
2012-01-31 11:20:52 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
Vector3 location;
|
|
|
|
double yaw;
|
|
|
|
double pitch;
|
|
|
|
double roll;
|
|
|
|
|
|
|
|
Vector3 target;
|
|
|
|
Vector3 forward;
|
|
|
|
Vector3 right;
|
|
|
|
Vector3 up;
|
|
|
|
|
|
|
|
double width;
|
|
|
|
double height;
|
|
|
|
double yfov;
|
|
|
|
double xratio;
|
|
|
|
double znear;
|
|
|
|
double zfar;
|
|
|
|
|
|
|
|
Matrix4 project;
|
|
|
|
Matrix4 unproject;
|
|
|
|
} CameraDefinition;
|
|
|
|
|
2011-12-23 22:58:50 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-12-10 13:25:22 +00:00
|
|
|
#endif
|