Michaël Lemaire
a338872c82
git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@330 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
104 lines
1.7 KiB
C
104 lines
1.7 KiB
C
#ifndef _PAYSAGES_TYPES_H_
|
|
#define _PAYSAGES_TYPES_H_
|
|
|
|
#include "../euclid.h"
|
|
#include "../color.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
struct RenderFragment;
|
|
struct Renderer;
|
|
|
|
typedef int(*f_RenderFragmentCallback)(struct RenderFragment*, struct Renderer* renderer, void* data);
|
|
|
|
typedef struct
|
|
{
|
|
Vector3 location;
|
|
Vector3 normal;
|
|
Color color;
|
|
f_RenderFragmentCallback callback;
|
|
void* callback_data;
|
|
} 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;
|
|
|
|
typedef struct
|
|
{
|
|
Color base;
|
|
double reflection;
|
|
double shininess;
|
|
} SurfaceMaterial;
|
|
|
|
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 hit;
|
|
Color hit_color;
|
|
Vector3 hit_location;
|
|
} RayCastingResult;
|
|
typedef RayCastingResult (*RayCastingFunction)(Vector3 start, Vector3 direction);
|
|
|
|
typedef struct
|
|
{
|
|
double min_height;
|
|
double max_height;
|
|
double base_height;
|
|
} HeightInfo;
|
|
|
|
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;
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|