A
download timer.cpp
Language: C++
LOC: 23
Project Info
TableHockey3D(tablehockey)
Server: SourceForge
Type: cvs
...ey\CVSROOT\tablehockey\src\
   Application.cpp
   Application.h
   Camera.cpp
   Camera.h
   Cube.cpp
   Cube.h
   Data.cpp
   Data.h
   Disk.cpp
   Disk.h
   FloatingText.cpp
   FloatingText.h
   Floor.cpp
   Floor.h
   Input.cpp
   Input.h
   Light.cpp
   Light.h
   log.cpp
   log.h
   main.cpp
   mmgr.cpp
   mmgr.h
   Model.cpp
   Model.h
   nommgr.h
   Puck.cpp
   Puck.h
   Pyramid.cpp
   Pyramid.h
   scene.cpp
   scene.h
   SmartPtr.h
   Sound.cpp
   Sound.h
   TableHockey.dsp
   TableHockey.dsw
   TestScene.cpp
   TestScene.h
   text.cpp
   text.h
   TextHelp.cpp
   TextHelp.h
   texture.cpp
   texture.h
   TexturedCube.cpp
   TexturedCube.h
   timer.cpp
   timer.h
   View.cpp
   View.h

/*=============================================================================
	timer.cpp: Basic OpenGL Framework timer function definitions

    Revision history:
	* Created by Zack Smith
=============================================================================*/

#include <windows.h>		// Header File For Windows

#include "timer.h"          // Header file that handles timing
#include "application.h"

/*-----------------------------------------------------------------------------
   CTimer class function definitions.
-----------------------------------------------------------------------------*/

CTimer::CTimer()
{
	pApp->pLog->Log("Timer Class...initialized");
}

CTimer::~CTimer()
{
	pApp->pLog->Log("Timer Class...destroyed");
}

void CTimer::init()
{
	Tick1 = initial_time = GetTickCount ();            // Gets time in milliseconds
	Tick2 = GetTickCount ( );
	DTick = (float)((Tick2 - Tick1));                  // Change in time
}

void CTimer::update()
{
	Tick1 = Tick2;
	Tick2 = GetTickCount ( );
	DTick = (float)((Tick2 - Tick1));
}

/*-----------------------------------------------------------------------------
	The End.
-----------------------------------------------------------------------------*/

About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us