
#include <windows.h>
#include <stdio.h>


#include <gl\gl.h>	
#include <gl\glu.h>	
#include <gl\glaux.h>




#define OGL_SZX		640//$$
#define OGL_SZY		480			//$$		<-- tout ca dans une setup dialogbox
#define OGL_DISPX	0
#define OGL_DISPY	0

//#define OGL_ZFOV	-2.45f			//			!!!!!!!!!!!! don't touch these parameter !!!!!!!!!!!!!
#define OGL_MINX	-640.0/480.0		//			!!<<<
#define OGL_MAXX    640.0/480.0		//			!!<<<
#define OGL_MINY    -1.0		//			!!<<<
#define OGL_MAXY	1.0			//			!!<<<

#define BITDEPTH	32			//$$
#define ZBITDEPTH   16			//$$

#define INV256 1.0/256.0


extern GLfloat OGL_ZFOV;


#ifndef _MAIN_STRUCT_H_
#define _MAIN_STRUCT_H_

extern float spritex, spritey;


inline int random(int max)
{
    // random number
    return rand() % max;
}

inline float normalizedrandom()
{
    // random number
    return (rand() % 121314)/121314.0;
}

typedef struct {
 float r,g,b;
} FLOATcolor;


typedef struct {
 float x,y;
} Vect2D;

typedef struct {
 float x,y,z;
} Vect3D;


void TIMER_init_timer();
int TIMER_return_timer();
float INTERPOLATE_float(int time1, int time2, float value1, float value2, int current_hz);
int INTERPOLATE_long(int time1, int time2, int value1, int value2, int current_hz);

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

void HAND_draw(GLfloat zoom, Vect2D displace, GLfloat rotat, GLfloat alpha);
void BRUSH_draw(GLfloat zoom, Vect2D displace, GLfloat rotat, GLfloat alpha, Vect3D color);
void LAYER_buffer(float alpha, float zooma);
void MASK_draw(GLfloat zoomx, GLfloat zoomy, GLfloat dispx, GLfloat dispy, GLfloat rotat);

void BONHOMME_draw();
void BONHOMME_interpolate(float normalized_step);
void BONHOMME_fill_end();

void CIEL_LAYER(float zooma);


void SPLINES_Draw_Parametric(float maxt, int nb_pts, int intrasteps, float zoom, float alpha, 
							 Vect2D move, int style_x, int style_y, int blendstyle, float rotat, Vect3D color);


void LAYER_flat(Vect3D color, float alpha);
/**************************************************************************************************************/

extern float ACCURATE_TIMER;

extern FILE *debugfile;
extern GLuint texturebuffer;
extern unsigned char lcdlogo[8639];


#define TOTAL_TEXTURES 7


extern GLuint			textures[TOTAL_TEXTURES];   
extern unsigned char   *textures_buffer0;
extern unsigned char   *textures_buffer1;
extern unsigned char   *textures_buffer2;

extern GLuint			texturebuffer; 
extern unsigned char   *bigtexture_buffer;

extern GLuint			temptexture;
extern GLuint			spritebubble;
extern GLuint			spriteleaf;

extern GLuint			textureboule,textureboule2, masque2;
extern GLuint			houdini_frames[30];  

extern char *genox_mxm;

extern int current_hertz;

extern float  KEY_POS_X;		
extern float  KEY_POS_Y;	
extern float  KEY_ZOOM;		



#endif
