mirror of
https://github.com/recastnavigation/recastnavigation.git
synced 2026-09-28 13:06:19 +00:00
Hasty before flight check in. Some adjustments to VO code (renaming, optimize segment sampling). Crowd sim performance graph.
This commit is contained in:
@@ -174,6 +174,49 @@ int BuildContext::getBuildTime(const rcBuilTimeLabel label)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(WIN32)
|
||||
|
||||
// Win32
|
||||
#include <windows.h>
|
||||
|
||||
rcTimeVal getPerfTime()
|
||||
{
|
||||
__int64 count;
|
||||
QueryPerformanceCounter((LARGE_INTEGER*)&count);
|
||||
return count;
|
||||
}
|
||||
|
||||
int getPerfDeltaTimeUsec(const rcTimeVal start, const rcTimeVal end)
|
||||
{
|
||||
static __int64 freq = 0;
|
||||
if (freq == 0)
|
||||
QueryPerformanceFrequency((LARGE_INTEGER*)&freq);
|
||||
__int64 elapsed = end - start;
|
||||
return (int)(elapsed*1000000 / freq);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// Linux, BSD, OSX
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
rcTimeVal getPerfTime()
|
||||
{
|
||||
timeval now;
|
||||
gettimeofday(&now, 0);
|
||||
return (rcTimeVal)now.tv_sec*1000000L + (rcTimeVal)now.tv_usec;
|
||||
}
|
||||
|
||||
int getPerfDeltaTimeUsec(const rcTimeVal start, const rcTimeVal end)
|
||||
{
|
||||
return (int)(end - start);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void DebugDrawGL::depthMask(bool state)
|
||||
{
|
||||
glDepthMask(state ? GL_TRUE : GL_FALSE);
|
||||
|
||||
Reference in New Issue
Block a user