mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 16:52:57 +00:00
Formatting pass.
This commit is contained in:
+19
-23
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user