#ifndef treelibH
#define treelibH


#define TL_RENDER_STRATEGY              0x0100
#define TL_IMPOSTER_RESOLUTION          0x0101
#define TL_MAX_IMPOSTERS_PER_FRAME      0x0102
#define TL_USE_BARK_SHADERS             0x0103
#define TL_EXPORTED_FLOATS_PER_VERTEX   0x0104
#define TL_EXPORTED_FLOATS_PER_LEAF     0x0105
#define TL_SUPPRESS_WARNINGS            0x0106
#define TL_SHADER_ALPHA_TEST            0x0107
#define TL_DEPTHLESS_IMPOSTERS          0x0108

#define TL_ERROR                        0x0300
#define TL_VERSION                      0x0301

#define TL_WIND                         0x0400

#define TL_ANISOTROPY                   0x0200
#define TL_IMPOSTER_RANGE               0x0201
#define TL_MAX_VIEWING_DISTANCE         0x0202
#define TL_SCALE                        0x0203
#define TL_SNOW_DENSITY                 0x0204

#define TL_FACES                        0x1100
#define TL_NODES                        0x1101
#define TL_BRANCHES                     0x1102
#define TL_LEAVES                       0x1103
#define TL_VERTEX_PATH_LENGTH           0x1104
#define TL_INDEX_PATH_LENGTH            0x1105


#define TL_BOX_LOWER_CORNER             0x1400
#define TL_BOX_UPPER_CORNER             0x1401
#define TL_CENTER                       0x1402

#define TL_RADIUS                       0x1200

#define TL_SEED                         0x2100
#define TL_SHADOW                       0x2101
#define TL_AUTO_BALANCE                 0x2102
#define TL_ROTATE_LEAVES                0x2103
#define TL_BARK_TEXTURE                 0x2104
#define TL_BARK_BUMP_MAP                0x2105
#define TL_LEAF_TEXTURE                 0x2106
#define TL_BOTTOM_CAP                   0x2107
#define TL_LOWER_BRANCH_MIN_GENERATION  0x2108
#define TL_UPPER_BRANCH_MIN_GENERATION  0x2109
#define TL_MAX_RECURSION_LEVEL          0x210A
#define TL_MIN_GENERATION_LEAP          0x210B
#define TL_MAX_GENERATION_LEAP          0x210C
#define TL_MIN_BRANCH_LENGTH            0x210D
#define TL_MAX_BRANCH_LENGTH            0x210E
#define TL_MAX_GENERATION               0x210F
#define TL_GENERATIONS_PER_STEP         0x2110
#define TL_TILING                       0x2111

//#define TL_TREE_TYPE                    0x2110


#define TL_AGE                          0x2200
#define TL_LOD                          0x2201
#define TL_LOD_FALLOFF                  0x2202
#define TL_LEAF_SIZE                    0x2203
#define TL_SEGMENT_LENGTH               0x2204
#define TL_GENERATION_RADIUS            0x2205
#define TL_VARIANCE                     0x2206
#define TL_LOWER_MIN_DEVIATION          0x2207
#define TL_UPPER_MIN_DEVIATION          0x2208
#define TL_IDEAL_CHILD_DEVIATION        0x2209
#define TL_CHILD_DEVIATION_TOLERANCE    0x220A
#define TL_VERTICAL_ORIENTATION         0x220B
#define TL_FLEETING_ORIENTATION         0x220C
#define TL_MIN_BRANCH_AGE               0x220D
#define TL_MAX_BRANCH_AGE               0x220E
#define TL_LEAF_IDEAL_BRANCH_AGE        0x220F
#define TL_LEAF_BRANCH_AGE_TOLERANCE    0x2210
#define TL_SHADOW_CONE_STEEPNESS        0x2211
#define TL_BOTTOM_CAP_STEEPNESS         0x2212


#define TL_VERTEX_PATH                  0x1403        //{x,y,z,nx,ny,nz,tx,ty,tz,u,v,wstrength,wphase}
#define TL_INDEX_PATH                   0x1500
#define TL_LEAF_PATH                    0x1404        //{x,y,z,wstrength,wphase}


/* shadow constants */

#define TL_NO_SHADOW                    0
#define TL_FLAT_BLOB_SHADOW             1
#define TL_CONICAL_BLOB_SHADOW          2


/* bottom cap constants */

#define TL_NO_CAP                       0
#define TL_FLAT_CAP                     1
#define TL_POINTY_CAP                   2

#define TL_ROUNDED_POINTY_CAP           3    //not implemented yet
#define TL_SPHERIC_CAP                  4    //not implemented yet


/* tree type constants */

#define TL_DEFAULT_TREE                 0
#define TL_FOREST_TREE                  1


/* render strategy */

#define TL_CPU_TRANSFORM                0
#define TL_COLLAPSED_QUADS              1
#define TL_POINTS                       2
#define TL_COLLAPSED_QUADS_SHADER       3
#define TL_POINTS_SHADER                4
#define TL_BEST_AVAILABLE               5




namespace TreeLib
{
    typedef int     Attribute;
    typedef void*   Tree;
	
    typedef bool        (*_explicitInit)(const char*);                      //_ZN7TreeLib4initEPKc				?init@TreeLib@@YA_NPBD@Z
    typedef bool        (*_implicitInit)();                                 //_ZN7TreeLib4initEv					?init@TreeLib@@YA_NXZ
    typedef Tree        (*_createTree)();                                   //_ZN7TreeLib10createTreeEv			?createTree@TreeLib@@YAPAXXZ
    typedef Tree        (*_createTreeFromSeed)(int);                        //_ZN7TreeLib18createTreeFromSeedEi		?createTreeFromSeed@TreeLib@@YAPAXH@Z
    typedef void        (*_discardTree)(Tree);                              //_ZN7TreeLib11discardTreeEPv			?discardTree@TreeLib@@YAXPAX@Z
    typedef void        (*_rebuildTree)(Tree);                              //_ZN7TreeLib11rebuildTreeEPv			?rebuildTree@TreeLib@@YAXPAX@Z
    typedef float       (*_getAttributef)(Tree,Attribute);                  //_ZN7TreeLib13getAttributefEPvi			?getAttributef@TreeLib@@YAMPAXH@Z
    typedef const float*(*_getAttributefv)(Tree,Attribute);                 //_ZN7TreeLib14getAttributefvEPvi		?getAttributefv@TreeLib@@YAPBMPAXH@Z
    typedef int         (*_getAttributei)(Tree,Attribute);                  //_ZN7TreeLib13getAttributeiEPvi			?getAttributei@TreeLib@@YAHPAXH@Z
    typedef const int*  (*_getAttributeiv)(Tree,Attribute);                 //_ZN7TreeLib14getAttributeivEPvi		?getAttributeiv@TreeLib@@YAPBHPAXH@Z
    typedef const char* (*_getAttributecv)(Tree,Attribute);                 //_ZN7TreeLib14getAttributecvEPvi		?getAttributecv@TreeLib@@YAPBDPAXH@Z

    typedef bool        (*_setAttributef)(Tree,Attribute,float);            //_ZN7TreeLib13setAttributefEPvif			?setAttributef@TreeLib@@YA_NPAXHM@Z
    typedef bool        (*_setAttributefv)(Tree,Attribute,const float*);    //_ZN7TreeLib14setAttributefvEPviPKf			?setAttributefv@TreeLib@@YA_NPAXHPBM@Z
    typedef bool        (*_setAttributei)(Tree,Attribute,int);              //_ZN7TreeLib13setAttributeiEPvii				?setAttributei@TreeLib@@YA_NPAXHH@Z
    typedef bool        (*_setAttributecv)(Tree,Attribute,const char*);     //_ZN7TreeLib14setAttributecvEPviPKc			?setAttributecv@TreeLib@@YA_NPAXHPBD@Z
    typedef bool        (*_pushAttributes)();                               //_ZN7TreeLib14pushAttributesEv				?pushAttributes@TreeLib@@YA_NXZ
    typedef bool        (*_popAttributes)();                                //_ZN7TreeLib13popAttributesEv				?popAttributes@TreeLib@@YA_NXZ
    typedef int         (*_saveAttributes)();                               //_ZN7TreeLib14saveAttributesEv				?saveAttributes@TreeLib@@YAHXZ
    typedef bool        (*_loadAttributes)(Tree,int configuration);         //_ZN7TreeLib14loadAttributesEPvi			?loadAttributes@TreeLib@@YA_NPAXH@Z
    typedef bool        (*_freeAttributes)(int configuration);              //_ZN7TreeLib14freeAttributesEi				?freeAttributes@TreeLib@@YA_NH@Z

    typedef bool        (*_renderCompositionLeaves)();                      //_ZN7TreeLib23renderCompositionLeavesEv		?renderCompositionLeaves@TreeLib@@YA_NXZ
    typedef bool        (*_renderCompositionShadows)();                     //_ZN7TreeLib24renderCompositionShadowsEv		?renderCompositionShadows@TreeLib@@YA_NXZ
    typedef bool        (*_renderCompositionBranches)();                    //_ZN7TreeLib25renderCompositionBranchesEv		?renderCompositionBranches@TreeLib@@YA_NXZ
    typedef bool        (*_renderCompositionImposters)();                   //_ZN7TreeLib26renderCompositionImpostersEv	?renderCompositionImposters@TreeLib@@YA_NXZ
    typedef void        (*_flushComposition)();                             //_ZN7TreeLib16flushCompositionEv			?flushComposition@TreeLib@@YAXXZ
    typedef bool        (*_renderComposition)();                            //_ZN7TreeLib17renderCompositionEv			?renderComposition@TreeLib@@YA_NXZ
    typedef bool        (*_putTree)(Tree, const float position[3], const float up[3], const float right[3]);    //_ZN7TreeLib7putTreeEPvPKfS2_S2_		?putTree@TreeLib@@YA_NPAXQBM11@Z
    
    
    typedef bool        (*_preloadGlobalTextures)();                            //_ZN7TreeLib21preloadGlobalTexturesEv	?preloadGlobalTextures@TreeLib@@YA_NXZ
    typedef int         (*_preloadTexture)(const char*filename, bool equalize); //_ZN7TreeLib14preloadTextureEPKcb		?preloadTexture@TreeLib@@YAHPBD_N@Z
    typedef int         (*_preloadNormalMap)(const char*filename);              //_ZN7TreeLib16preloadNormalMapEPKc		?preloadNormalMap@TreeLib@@YAHPBD@Z

    
}

#endif

