mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2025-02-16 17:35:39 +00:00
Added CThread::Sleep && CThread::GetTicks methods
This commit is contained in:
parent
67036014f8
commit
b7242d27e8
|
@ -35,6 +35,16 @@
|
||||||
#include <SDL_thread.h>
|
#include <SDL_thread.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void CThread::Sleep(UINT32 ms)
|
||||||
|
{
|
||||||
|
SDL_Delay(ms);
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT32 CThread::GetTicks()
|
||||||
|
{
|
||||||
|
return SDL_GetTicks();
|
||||||
|
}
|
||||||
|
|
||||||
CThread *CThread::CreateThread(ThreadStart start, void *startParam)
|
CThread *CThread::CreateThread(ThreadStart start, void *startParam)
|
||||||
{
|
{
|
||||||
SDL_Thread *impl = SDL_CreateThread(start, startParam);
|
SDL_Thread *impl = SDL_CreateThread(start, startParam);
|
||||||
|
|
|
@ -48,6 +48,20 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*
|
/*
|
||||||
|
* Sleep
|
||||||
|
*
|
||||||
|
* Sleeps for specified number of milliseconds.
|
||||||
|
*/
|
||||||
|
static void Sleep(UINT32 ms);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GetTicks
|
||||||
|
*
|
||||||
|
* Gets number of millseconds since beginning of program.
|
||||||
|
*/
|
||||||
|
static UINT32 GetTicks();
|
||||||
|
|
||||||
|
/*
|
||||||
* CreateThread
|
* CreateThread
|
||||||
*
|
*
|
||||||
* Creates a new thread with the given ThreadStart callback and start parameter. The thread starts running immediately.
|
* Creates a new thread with the given ThreadStart callback and start parameter. The thread starts running immediately.
|
||||||
|
|
Loading…
Reference in a new issue