/*
 *
 * Copyright (C) 2008 Fontaine Clément
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * this program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 */
/*
 *
 * Fichier : fenetre.
 * Créé par Fontaine Clément <clement@the-sith.servhome.org>.
 * Date de création le 19/06/08.
 * Date de modification le 20/06/08.
 * Déscription : manipuler les fenêtres avec la SDL et OpenGL avec en plus
 * quelques fonctions pour la 3D et pour gerer le temps.
 *
 */

#ifndef DEF_SDL_GL
#define DEF_SDL_GL

#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include "liste.h"

#define TAILLE_TEXTE 12
#define FICHIER_TTF "police.ttf"

/* ouvre une fenêtre en pleine ecran */
void fenetrePleineEcran(SDL_Surface **ecran);

/* ouvre une fenêtre d'une taille données */
void fenetreTaille(SDL_Surface **ecran, const coordonnees taille);

/* crée une perspective avec OpenGL */
void fenetrePerspective(const SDL_Surface *ecran, const int fovy, const int near, const int far);

/* modifie le titre de la fenêtre */
void fenetreTitre(const char *titre);

/* met à jour la fenêtre */
void fenetreAfficher(void);

/* destructeur de fin de vie de la fenêtre */
void fenetreDetruire(SDL_Surface *ecran);

/* initialiser le temps de depart */
void tempsInitialiser(unsigned int *depart);

/* faire une pause dans le programme */
void tempsPause(unsigned int *ecart, unsigned int debut, unsigned int temporisation);

/* mettre à jour le temps */
void tempsActualiser(unsigned int *ecart, unsigned int *courant, unsigned int *ancien);

/* obtenir un pixel d'une surface */
Uint32 pixel(SDL_Surface *surface, int x, int y);

#endif
