include/timer.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *            timer.h
00003  *
00004  *  Wed Jun  1 21:31:59 2005
00005  *  Copyright  2005  Joe Venzon
00006  *  joe@venzon.net
00007  ****************************************************************************/
00008 
00009 /*
00010  *  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU Library General Public License for more details.
00019  *
00020  *  You should have received a copy of the GNU General Public License
00021  *  along with this program; if not, write to the Free Software
00022  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00023  */
00024  
00025 #ifndef _TIMER_H
00026 
00027 #include <stdio.h>                      // Header File For Standard Input/Output
00028 #include <GL/gl.h>
00029 #include <GL/glu.h>
00030 #include <SDL/SDL.h>
00031 #ifdef __APPLE__
00032 #include <SDL_image/SDL_image.h>
00033 #else
00034 #include <SDL/SDL_image.h>
00035 #endif
00036 #include <string>
00037 #include <iostream>
00038 #include <fstream>
00039 #include <cmath>
00040 #include <cassert>
00041 
00042 using namespace std;
00043 
00044 #include "font.h"
00045 #include "utility.h"
00046 #include "gamestate.h"
00047 #include "settings.h"
00048 #include "globals.h"
00049 
00050 #define STAGING_TIME 4.0
00051 
00052 class TIMER
00053 {
00054 private:
00055         double time;
00056         double pretime;
00057         double lastlap;
00058         double bestlap;
00059         void SecsToSecsMin(double t, float &secs, int &min);
00060         TEXTURE_HANDLE timerbox;
00061 
00062         bool loaded;
00063 
00064 public:
00065         TIMER();
00066         ~TIMER();
00067         void Load();
00068         void Reset();
00069         void Lap(bool storelastlap);
00070         float GetTimer();
00071         void TickTimer(float timefactor, float fps);
00072         void ResetBest();
00073         void ResetLast();
00074 
00075         void Draw();
00076 };
00077 
00078 #define _TIMER_H
00079 #endif /* _TIMER_H */

Generated on Thu Oct 19 04:05:47 2006 by  doxygen 1.4.6