Formatting pass.

This commit is contained in:
Camilla Berglund
2010-09-10 22:03:36 +02:00
parent 484a2714fc
commit 479c9255fc
7 changed files with 725 additions and 876 deletions
+19 -23
View File
@@ -31,29 +31,29 @@
#include "internal.h"
//************************************************************************
//**** GLFW internal functions ****
//************************************************************************
//////////////////////////////////////////////////////////////////////////
////// GLFW internal API //////
//////////////////////////////////////////////////////////////////////////
//========================================================================
// Initialise timer
//========================================================================
void _glfwInitTimer( void )
void _glfwInitTimer(void)
{
__int64 freq;
// Check if we have a performance counter
if( QueryPerformanceFrequency( (LARGE_INTEGER *)&freq ) )
if (QueryPerformanceFrequency((LARGE_INTEGER*) &freq))
{
// Performance counter is available => use it!
_glfwLibrary.Timer.HasPerformanceCounter = GL_TRUE;
// Counter resolution is 1 / counter frequency
_glfwLibrary.Timer.Resolution = 1.0 / (double)freq;
_glfwLibrary.Timer.Resolution = 1.0 / (double) freq;
// Set start time for timer
QueryPerformanceCounter( (LARGE_INTEGER *)&_glfwLibrary.Timer.t0_64 );
QueryPerformanceCounter((LARGE_INTEGER*) &_glfwLibrary.Timer.t0_64);
}
else
{
@@ -69,28 +69,26 @@ void _glfwInitTimer( void )
}
//************************************************************************
//**** Platform implementation functions ****
//************************************************************************
//////////////////////////////////////////////////////////////////////////
////// GLFW platform API //////
//////////////////////////////////////////////////////////////////////////
//========================================================================
// Return timer value in seconds
//========================================================================
double _glfwPlatformGetTime( void )
double _glfwPlatformGetTime(void)
{
double t;
double t;
__int64 t_64;
if( _glfwLibrary.Timer.HasPerformanceCounter )
if (_glfwLibrary.Timer.HasPerformanceCounter)
{
QueryPerformanceCounter( (LARGE_INTEGER *)&t_64 );
QueryPerformanceCounter((LARGE_INTEGER*) &t_64);
t = (double)(t_64 - _glfwLibrary.Timer.t0_64);
}
else
{
t = (double)(_glfw_timeGetTime() - _glfwLibrary.Timer.t0_32);
}
// Calculate the current time in seconds
return t * _glfwLibrary.Timer.Resolution;
@@ -101,18 +99,16 @@ double _glfwPlatformGetTime( void )
// Set timer value in seconds
//========================================================================
void _glfwPlatformSetTime( double t )
void _glfwPlatformSetTime(double t)
{
__int64 t_64;
if( _glfwLibrary.Timer.HasPerformanceCounter )
if (_glfwLibrary.Timer.HasPerformanceCounter)
{
QueryPerformanceCounter( (LARGE_INTEGER *)&t_64 );
_glfwLibrary.Timer.t0_64 = t_64 - (__int64)(t/_glfwLibrary.Timer.Resolution);
QueryPerformanceCounter((LARGE_INTEGER*) &t_64);
_glfwLibrary.Timer.t0_64 = t_64 - (__int64) (t / _glfwLibrary.Timer.Resolution);
}
else
{
_glfwLibrary.Timer.t0_32 = _glfw_timeGetTime() - (int)(t*1000.0);
}
_glfwLibrary.Timer.t0_32 = _glfw_timeGetTime() - (int)(t * 1000.0);
}