Hi,
I just discovered that applications or other libraries (VRJuggler being
one of them) that include windows.h with WIN32_LEAN_AND_MEAN defined
before OSGConfig can do so *without* the definition break inside
OSGTime.inl because timeGetTime is not declared then :(
Below is a possible fallback implementation [1], but I was wondering if
we could just move the code to a .cpp and not have to worry about
differing precision, availability of the fallback across windows
versions etc.
Opinions?
Cheers,
Carsten
[1] I did not try this yet, because I still have other builds running
inline
OSG::Time getSystemTime (void)
{
Time time;
#ifdef WIN32
# ifndef WINMMAPI
# warning "Windows Multimedia timers not available using fallback."
FILETIME ft;
ULARGE_INTEGER uli;
GetSystemTimeAsFileTime(&ft);
uli.LowPart = ft.dwLowDateTime;
uli.HightPart = ft.dwHighDateTime;
time = uli.QuadPart;
# else
time = Time(timeGetTime()) / 1000.0;
# endif // WINMMAPI
#else
struct timeval tv;
gettimeofday(&tv, 0);
time = Time(tv.tv_usec) / 1000000.0 + Time(tv.tv_sec);
#endif
return time;
}
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Opensg-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-core