usleep() did not work on Windows - modified ag.cc to use Sleep()
git-svn-id: svn://anubis/anaglym/trunk@38 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
parent
9d95158176
commit
4bca35ee69
7
ag.cc
7
ag.cc
@ -10,6 +10,9 @@
|
||||
#include <string>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
#ifdef _WIN32
|
||||
#include <windows.h> /* Sleep() */
|
||||
#endif
|
||||
using namespace std;
|
||||
|
||||
namespace ag
|
||||
@ -157,7 +160,11 @@ namespace ag
|
||||
if (lua_type(L, -1) == LUA_TNUMBER)
|
||||
{
|
||||
double seconds = lua_tonumber(L, -1);
|
||||
#ifdef _WIN32
|
||||
Sleep((DWORD)(seconds * 1000));
|
||||
#else
|
||||
usleep((useconds_t) (seconds * 1000000));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user