/*****************************************************************************

  PROJECT:
  dPL

  FILE:
  dpltypes.h

  CONTENTS:
  Public type definitions for the dPL library.

*****************************************************************************/

#ifndef _DPL_TYPES_H
#define _DPL_TYPES_H

#include <stdio.h>
#include <dsys/divtypes.h>

#ifdef __cplusplus
extern "C" {
#endif

/* dpl_TYPE definitions are used as tokenised identifiers for the various
   coarse dPL database elements. */

typedef enum dpl_TYPE
{
    dpl_type_error,
    dpl_type_scene,
    dpl_type_zones,
    dpl_type_view,
    dpl_type_instance,
    dpl_type_dcs,
    dpl_type_light,
    dpl_type_object,
    dpl_type_lod,
    dpl_type_geogroup,
    dpl_type_geometry,
    dpl_type_material,
    dpl_type_texture,
    dpl_type_texmap,
    dpl_type_ramp
} dpl_TYPE;

/* dpl_LIGHT_TYPE definitions are light type tokens identifying the behaviour
   of a particular dPL light. */

typedef enum dpl_LIGHT_TYPE
{
    dpl_light_type_error,
    dpl_light_type_disable,
    dpl_light_type_ambient,
    dpl_light_type_directional,
    dpl_light_type_point,
    dpl_light_type_conical
} dpl_LIGHT_TYPE;

/* dpl_GEO_TYPE indicates which form of data a geometry database element
   represents. */

typedef enum dpl_GEO_TYPE
{
    dpl_geo_type_error,
    dpl_geo_type_empty,
    dpl_geo_type_tristrip,
    dpl_geo_type_polystrip,
    dpl_geo_type_polygon,
    dpl_geo_type_pmesh,
    dpl_geo_type_string,
    dpl_geo_type_lines,
    dpl_geo_type_polyline,
    dpl_geo_type_polypoints,
    dpl_geo_type_spheres
} dpl_GEO_TYPE;

/* dpl_ISECT_MODE is used to determine how detailed an intersection
   calculation is to be performed by the renderer for a given instance,
   providing a means of controlling the amount of time taken to obtain
   intersection information. */

typedef enum dpl_ISECT_MODE
{
    dpl_isect_mode_error,
    dpl_isect_mode_obj,
    dpl_isect_mode_geogroup,
    dpl_isect_mode_geometry
} dpl_ISECT_MODE;

/* dpl_MORPH_MODE selects a mode of interpolation between the low level
   geometry. */

typedef enum dpl_MORPH_MODE
{
    dpl_morph_mode_error,
    dpl_morph_mode_simple,
    dpl_morph_mode_blend
} dpl_MORPH_MODE;

/* dpl_TEX_PROP are the various properties of a texture which may be
   manipulated to control a texmaps application over polygons. */

typedef enum dpl_TEX_PROP
{
    dpl_tex_prop_error,
    dpl_tex_prop_spheremap,
    dpl_tex_prop_wrap,
    dpl_tex_prop_wrapu,
    dpl_tex_prop_wrapv,
    dpl_tex_prop_minfilter,
    dpl_tex_prop_magfilter,
    dpl_tex_prop_alpha, 
    dpl_tex_prop_detail,
    dpl_tex_prop_reduce,
    dpl_tex_prop_bitslice
} dpl_TEX_PROP;

/* dpl_TEX_VALUE are the values which may be assigned to the texture property
   fields in a texture elements. */

typedef enum dpl_TEX_VALUE
{
    dpl_tex_value_error,
    dpl_tex_value_on,
    dpl_tex_value_off,
    dpl_tex_value_repeat,
    dpl_tex_value_clamp,
    dpl_tex_value_select,
    dpl_tex_value_blend,
    dpl_tex_value_cut, 
    dpl_tex_value_blendcut, 
    dpl_tex_value_point,
    dpl_tex_value_bilinear,
    dpl_tex_value_trilinear,
    dpl_tex_value_bicubic,
    dpl_tex_value_sharpen,
    dpl_tex_value_mipmap_point,
    dpl_tex_value_mipmap_linear,
    dpl_tex_value_mipmap_bilinear,
    dpl_tex_value_mipmap_trilinear,
    dpl_tex_value_mipmap_quadlinear,
    dpl_tex_value_slice_mode0,
    dpl_tex_value_slice_mode1,
    dpl_tex_value_slice_mode2,
    dpl_tex_value_slice_mode3,
    dpl_tex_value_slice_mode4,
    dpl_tex_value_slice_mode5,
    dpl_tex_value_slice_mode6,
    dpl_tex_value_slice_mode7,
    dpl_tex_value_slice_mode8
} dpl_TEX_VALUE;

/* dpl_RENDER_PROP specifies global rendering properties which may be set to
   affect output in all views. */

typedef enum dpl_RENDER_PROP
{
    dpl_render_prop_error,
    dpl_render_prop_wireframe,
    dpl_render_prop_report,
    dpl_render_prop_singlebuffer,
    dpl_render_prop_framerate,
    dpl_render_prop_antialias,
    dpl_render_prop_windowed,
    dpl_render_prop_textured,
    dpl_render_prop_LODscale,
    dpl_render_prop_phase
} dpl_RENDER_PROP;

/* dpl_RENDER_VALUE defines the values which may be used to set the render
   properties. */

typedef enum dpl_RENDER_VALUE
{
    dpl_render_value_error, 
    dpl_render_value_on,
    dpl_render_value_off, 
    dpl_render_value_increase, 
    dpl_render_value_decrease,
    dpl_render_value_lock,
    dpl_render_value_float,
    dpl_render_value_free,
    dpl_render_value_limit
} dpl_RENDER_VALUE;

/* dpl_VERTEX_TYPE definitions are light type tokens identifying the behaviour
   of a particular dPL light. */

typedef enum dpl_VERTEX_TYPE
{
    dpl_vertex_type_error = 0x00,
    dpl_vertex_coord = 0x01,
    dpl_vertex_normal = 0x02,
    dpl_vertex_rgba = 0x04,
    dpl_vertex_luminance = 0x08,
    dpl_vertex_texture2D = 0x10,
    dpl_vertex_texture3D = 0x20,
    dpl_vertex_radius = 0x40
} dpl_VERTEX_TYPE;

/* dpl_REORIENT_AXES may be combined with an OR operation to switch billboard
   axes at DCS nodes. */

typedef enum dpl_REORIENT_AXES
{
    dpl_reorient_axes_none = 0x00,
    dpl_reorient_axes_x = 0x01,
    dpl_reorient_axes_y = 0x02,
    dpl_reorient_axes_z = 0x04
} dpl_REORIENT_AXES;

/* dpl_EFFECT_TYPE definitions are used in high level requests for specific
   types of effect from the dpl renderer. */

typedef enum dpl_EFFECT_TYPE
{
    dpl_effect_type_explosion,
    dpl_effect_type_particlestart,
    dpl_effect_type_particlestop,
    dpl_effect_type_particle
} dpl_EFFECT_TYPE;

/* dpl_WARN_LEVEL defines the various warning levels avaliable from the
   renderer */

typedef enum dpl_WARN_LEVEL
{
    dpl_warn_fatal,
    dpl_warn_warn,
    dpl_warn_notice,
    dpl_warn_info,
    dpl_warn_debug,
    dpl_warn_fp_debug
} dpl_WARN_LEVEL;

/* dpl_FOG_TYPE defines the various types of fog which can be applied to
   a dpl_VIEW, support for the various types is platform dependent */
typedef enum dpl_FOG_TYPE
{
    dpl_fog_type_error,                 /* error (feedback from querry) */
    dpl_fog_type_off,                   /* turn off fog for view */
    dpl_fog_type_vertex_lin,            /* apply linear fog per vertex */
    dpl_fog_type_vertex_exp,            /* exponential fog */
    dpl_fog_type_vertex_exp2,           /* exponential squared fog */
    dpl_fog_type_pixel_lin,             /* apply linear fog per pixel */
    dpl_fog_type_pixel_exp,             /* exponential fog */
    dpl_fog_type_pixel_exp2             /* exponential squared fog */
} dpl_FOG_TYPE;

typedef struct s_dpldcs dpl_DCS;

typedef struct s_dplview dpl_VIEW;

typedef struct s_dpllight dpl_LIGHT;

typedef struct s_dplzone dpl_ZONE;

typedef struct s_dplmtl dpl_MATERIAL;

typedef struct s_dplramp dpl_RAMP;

typedef struct s_dpltexture dpl_TEXTURE;

typedef struct s_dpltexmap dpl_TEXMAP;

typedef struct s_dplinstance dpl_INSTANCE;

typedef struct s_dplobject dpl_OBJECT;

typedef struct s_dpllod dpl_LOD;

typedef struct s_dplgeogroup dpl_GEOGROUP;

typedef struct s_dplgeometry dpl_GEOMETRY;

typedef void *dpl_LOAD_FUNCTION(char8 *);

typedef struct dpl_EXPLOSION_EFFECT_INFO {
	float32 x, y, z;        /* positional information */
	int32 type;             /* existing explosion options */
	dpl_TEXTURE *tex;       /* explosion texture */
} dpl_EXPLOSION_EFFECT_INFO;

typedef struct dpl_PARTICLESTART_EFFECT_INFO {
	int32 identifier;       /* the identifying tag of this effect */

	int32 maximum_issue;    /* maximum number to be released */
	float32 release_period; /* the period for which particles will be
				released */
	float32 rate;           /* the rate at which particles will be
				released */

	float32 px, py, pz, pv; /* position of release and radius of the
				variation in position */

	float32 velx, vely, velz;       /* initial velocity of particles */
	float32 velxv, velyv, velzv;    /* variation of particle velocity */

	float32 rad, radv;      /* size of particle radius and variation in
				the particle radius */
	float32 exp, expv;      /* rate of expansion and variation in that
				rate */
	float32 dexp, dexpv;    /* rate of change of expansion and variation
				   in that rate */

	float32 accelx, accely, accelz; /* acceleration of particles */
	float32 accelxv, accelyv, accelzv;/* and its variation */
	float32 atten, attenv;  /* resistance to particle motion and it's
				variation*/

	float32 sRi, sGi, sBi, sAi;     /* start colour interior */
	float32 sRiv, sGiv, sBiv, sAiv; /* and its variation */
	float32 sRo, sGo, sBo, sAo;     /* start colour exterior */
	float32 sRov, sGov, sBov, sAov; /* and its variation */

	float32 eRi, eGi, eBi, eAi;     /* end colour interior */
	float32 eRiv, eGiv, eBiv, eAiv; /* and its variation */
	float32 eRo, eGo, eBo, eAo;     /* end colour exterior */
	float32 eRov, eGov, eBov, eAov; /* and its variation */

	float32 colour_warp;    /* a warp factor allowing the interpolation
				of the above colours to be weighted towards
				the beginning or end using a gamma function
				1.0 = no weighting */

	float32 alpha_warp;    /* a warp factor for alpha (as above) */

	float32 dur, durv;      /* duration and variation in duration of
				particles */

	dpl_TEXTURE *tex;       /* particle texture (if supported) */
} dpl_PARTICLESTART_EFFECT_INFO;

typedef struct dpl_PARTICLESTOP_EFFECT_INFO {
	int32 identifier;       /* the identifying tag of all effects
				you want to stop */
} dpl_PARTICLESTOP_EFFECT_INFO;

typedef struct dpl_PARTICLE_EFFECT_INFO {
	float32 px, py, pz;     /* position of release */
	float32 velx, vely, velz;       /* initial velocity of particle */
	float32 rad;            /* size of particle radius */
	float32 exp;            /* rate of expansion */
	float32 dexp;           /* rate of change of expansion and variation */

	float32 accelx, accely, accelz; /* acceleration of particle */

	float32 atten;          /* resistance to particle motion */

	float32 sRi, sGi, sBi, sAi;     /* start colour interior */
	float32 sRo, sGo, sBo, sAo;     /* start colour exterior */

	float32 eRi, eGi, eBi, eAi;     /* end colour interior */
	float32 eRo, eGo, eBo, eAo;     /* end colour exterior */

	float32 colour_warp;    /* a warp factor allowing the interpolation
				of the above colours to be weighted towards
				the beginning or end using a gamma function
				1.0 = no weighting */

	float32 alpha_warp;    /* a warp factor for alpha (as above) */

	float32 dur;            /* duration of particle */

	dpl_TEXTURE *tex;       /* particle texture (if supported) */
} dpl_PARTICLE_EFFECT_INFO;

typedef struct dpl_STATISTICS {
	float32 framerate;
} dpl_STATISTICS;

typedef struct dpl_STATUS {
	int32 state;
} dpl_STATUS;

typedef struct dpl_CAPABILITY {
	/* is textured rendering supported */
		int32 textured_rendering;
	/* is texture font specification supported */
		int32 font_texture_update;
} dpl_CAPABILITY;

#ifdef __cplusplus
}
#endif

#endif
