/* NAME = glbb.h */
/*****************************************************/
/*    glbb.h: Variables globales pour anyflo         */
/*        Version du 11-07-2001 (6.1) (Michel BRET)  */
/*****************************************************/

#include "glba.h"
#include "defb.h"

/* Interface OpenGL */
/* ---------------- */
long GL_Dimx_Max, GL_Dimy_Max, GL_Dimx, GL_Dimy;
long X0, Y0;

/* Table des [oui non] */
long *Sem1;

/* Menus */
long Sem_menu;
Menus Menus0[NB_MENU];
Table_Menus Table_Menus0[NB_SOUS_MENU];
long Nb_menu;

/* Type d'affichage: 0 (off), 1 (image), -1 (memoire) */
long Sem_graph, Sem_aff, Sem_ecr;
/* Affichage image: 1 (on) -1 (off) */
long Sem_image;
/* Motion blur */
long *P_mb, Nb_mb;
float Coe_mb;

/* Dimension de l'image */
long Dimx, Dimy, Dim_image;
/* Cadres */
long X_interac, Y_interac, Dx_interac, Dy_interac;

/* Coefficients multiplicateurs */
float Kx, Ky, Coex, Coey, Coe_hautedef, Coe_gra;

/* Dimensions et centre de la fenetre */
long Minz, Maxz;
float Minz_ecr, Maxz_ecr;

/* Parametres de window */
long XW, YW;
long Dim_videox, Dim_videoy;
/* Fenetre[FEN_MEN,FEN_INT,FEN_PLA,FEN_SOU] */
int Fenetre[4];

/* Souris */
/* ------ */
Souris0 Souris;

/* Parametres de clip */
long Clipx1, Clipy1, Clipx2, Clipy2, Dim_clipx, Dim_clipy;
/* Nombre de bits d'une composante R V B */
long Nb_bit;

/* Valeur maximum d'une composante R V B*/
long Max_cou;

/* Ligne de pixels R V B */
long Dim_ligne;
unsigned char *Ligne_r, *Ligne_v, *Ligne_b, *Ligne_t;

/* Buffer de col */
float *Pile_col;

/* Facette standard de 4 sommets */
long *P_fac, *P_poi, *P_norm_fac, *P_norm_som;

/* Z_buf: 0 (off), 1(16 bits), 2 (32 bits), n octets */
long Z_buf;
short *Pz_16, *Fz_16;
float *Pz_32, *Fz_32;
long Dim_zbufx, Dim_zbufy, Dim_zbuf;


/* Oeil et perspective */
float *Oeil;
float *M_abs_oeil, *M_oeil_pers, *M_pers_ecr;
float *M_abs_pers, *M_oeil_abs, *M_pers_abs;
struct Objet *P_oeil, *P_fui, *P_foc, *P_roul;
struct Objet *P_abs_oeil, *P_oeil_pers, *P_pers_ecr;
struct Objet *P_ecr_pers, *P_pers_oeil, *P_oeil_abs;
struct Objet *P_locale_vue;
struct Objet *P_fonc_vue;
struct Objet *P_vue;
long *P_loi_pers;
long Type_Pers;

/* Peripheriques: OBSOLETE */
long Sem_tablette;
long Sem_magn;

/* Memoire partagee */
/* ---------------- */
Shm Shm0[NB_SHM];
long Nb_Shm;

/* Tableau des aleatoires */
long Dim_alea;    /* dim(Alea) */
long Alea_anc;    /* offset */
long Ind_alea;    /* Indice (entre 0 et Dim_alea - 1) */
float *Pile_alea;

/* Semaphore d'objets */
long Sem_vol, Sem_traj, Sem_cin;

/* Numero du volume affiche */
long Numero_vol, Numero_fac, Numero_som;

/* Objet courant */
struct Objet *P_obj_courant;

/* Fonction (interaction palette) */
struct Objet *P_fonc0, *P_fonc1, *P_fonc2, *P_fonc3;

/* Ombres */
long *Pile_intersection;

/* Ancrage */
long Sem_anc;
long Nb_anc;

/* Parametres d'animation */
long Dim_animer, Num_animer, Ni;
struct Objet *P_dessus, *P_devant, *P_derriere;

/* stocker objet */
long *P_stocker;
long Sem_interaction, Sem_memoire;

/* Pointeurs speciaux */
/* ------------------ */
struct Objet *P_wind;    /* Window courante */
struct Objet *P_champ;    /* Racine des champs */
struct Objet *P_lum;    /* Racine des lumiwres */
float *Pf_cou;
float *Pf_tsv;
float *Pf_col;
float *Pf_ambiance;
float *Pf_axe;
float *Pf_fond;
float *Pf_centre;
float *Pf_rayon;

float *Pf_poi;
float *Pf_move;
float *Pf_pers;
float *Pf_normale;
float *Pf_vitesse;
float *Pf_acc;
float *Pf_ang;
float *Pf_coe;
float *Pf_force;
float *Pf_dynamique;

float *Pf_oeil;
float *Pf_fui;
float *Pf_foc;
float Coe_foc;
float *Pf_roul;

float *Pf_clip;    /* -> clip window courante */
float *Pf_coupe;
float *Pf_fen;    /* -> fen window courante */

float *Pf_audio;
float *Pf_echelle;
float *Pf_souris;
long *P_souris;
long *P_memoire;

/* cou mappe */
float *Pr_mappe, *Pv_mappe, *Pb_mappe;

/* Haute_definition: (x0,y0,cx,cy) */
long *P_valider;

/* Marge du pave de couleurs R V B K */
long D_cou;

/* Nombre de parametres */
long Nb_coe, Nb_col, Nb_cou, Nb_normale, Nb_treil, Nb_mappe;

/* Interaction en temps reel */
char Buf_key[DIM_KEY];
long I_key, Sem_key;
long Interaction_Pas;

/* Table de cos */
double *TabCos;

/* Couleurs */
float Blanc[] = {1.0, 1.0, 1.0};
float Noir[] = {0.0, 0.0, 0.0};
float Rouge[] = {1.0, 0.0, 0.0};
float Vert[] = {0.0, 1.0, 0.0};
float Bleu[] = {0.0, 0.0, 1.0};
float Cyan[] = {0.0, 1.0, 1.0};
float Jaune[] = {1.0, 1.0, 0.0};
float Violet[] = {1.0, 0.0, 1.0};
float Col[] = {1.0, 1.0, 0.0, 0.0, 0.0, 0.0};

/* Image */
/* ----- */
struct Objet *P_image0;
unsigned char *P_rvb, *P_rvba;

/* Coupe */
/* ----- */
long Nb_coupe;
struct Contour *P_contour;

/* 1: ON, 0: OFF */
/* ------------- */
long P_exec[10000];
long P_menu[10000];

/* Play */
/* ---- */
/*???
long Sortie, *Pd_0, *Pd_eg_0, *Suite_0, *Fin_0;
???*/

/* Fonte */
/* ----- */
void *Fonte;

/* END */
