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-06-17 09:40:40 +00:00
|
|
|
|
2011-12-23 22:58:50 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-11-25 21:53:01 +00:00
|
|
|
typedef struct Renderer 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-06-17 09:40:40 +00:00
|
|
|
typedef Color (*f_RenderFragmentCallback)(struct Renderer* renderer, Vector3 location, void* data);
|
2011-12-10 13:25:22 +00:00
|
|
|
|
|
|
|
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;
|
2012-06-17 09:40:40 +00:00
|
|
|
double reflection;
|
|
|
|
double shininess;
|
2012-01-24 13:16:20 +00:00
|
|
|
} SurfaceMaterial;
|
|
|
|
|
2011-12-10 13:25:22 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int hit;
|
|
|
|
Color hit_color;
|
|
|
|
Vector3 hit_location;
|
|
|
|
} RayCastingResult;
|
2012-12-09 17:49:28 +00:00
|
|
|
typedef RayCastingResult (*FuncGeneralCastRay)(Renderer* renderer, Vector3 start, Vector3 direction);
|
2011-12-10 13:25:22 +00:00
|
|
|
|
2012-01-29 17:53:12 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2012-06-17 09:40:40 +00:00
|
|
|
double min_height;
|
|
|
|
double max_height;
|
|
|
|
double base_height;
|
2012-01-29 17:53:12 +00:00
|
|
|
} HeightInfo;
|
|
|
|
|
2012-01-31 11:20:52 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
Vector3 location;
|
2012-06-17 09:40:40 +00:00
|
|
|
double yaw;
|
|
|
|
double pitch;
|
|
|
|
double roll;
|
2012-12-09 17:49:28 +00:00
|
|
|
|
2012-01-31 11:20:52 +00:00
|
|
|
Vector3 target;
|
|
|
|
Vector3 forward;
|
|
|
|
Vector3 right;
|
|
|
|
Vector3 up;
|
2012-12-09 17:49:28 +00:00
|
|
|
|
2012-06-17 09:40:40 +00:00
|
|
|
double width;
|
|
|
|
double height;
|
|
|
|
double yfov;
|
|
|
|
double xratio;
|
|
|
|
double znear;
|
|
|
|
double zfar;
|
2012-12-09 17:49:28 +00:00
|
|
|
|
2012-01-31 11:20:52 +00:00
|
|
|
Matrix4 project;
|
|
|
|
Matrix4 unproject;
|
|
|
|
} CameraDefinition;
|
|
|
|
|
2012-12-09 17:49:28 +00:00
|
|
|
typedef void* (*FuncObjectCreate)();
|
|
|
|
typedef void (*FuncObjectDelete)(void* object);
|
|
|
|
typedef void (*FuncObjectCopy)(void* source, void* destination);
|
|
|
|
typedef void (*FuncObjectValidate)(void* object);
|
|
|
|
typedef void (*FuncObjectSave)(PackStream* stream, void* object);
|
|
|
|
typedef void (*FuncObjectLoad)(PackStream* stream, void* object);
|
|
|
|
typedef void (*FuncObjectBind)(void* base, void* sub);
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
FuncObjectCreate create;
|
|
|
|
FuncObjectDelete destroy;
|
|
|
|
FuncObjectCopy copy;
|
|
|
|
FuncObjectValidate validate;
|
|
|
|
FuncObjectSave save;
|
|
|
|
FuncObjectLoad load;
|
|
|
|
} StandardDefinition;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
FuncObjectCreate create;
|
|
|
|
FuncObjectDelete destroy;
|
|
|
|
FuncObjectBind bind;
|
|
|
|
} StandardRenderer;
|
|
|
|
|
2011-12-23 22:58:50 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-12-10 13:25:22 +00:00
|
|
|
#endif
|