summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/sdl2helper.cpp6
-rw-r--r--src/utils/sdl2helper.h5
-rw-r--r--src/utils/sdlhelper.cpp6
-rw-r--r--src/utils/sdlhelper.h5
4 files changed, 22 insertions, 0 deletions
diff --git a/src/utils/sdl2helper.cpp b/src/utils/sdl2helper.cpp
index a65f381b3..683a1b322 100644
--- a/src/utils/sdl2helper.cpp
+++ b/src/utils/sdl2helper.cpp
@@ -68,4 +68,10 @@ bool SDL::getWindowWMInfo(SDL_Window *const window, SDL_SysWMinfo *const info)
return SDL_GetWindowWMInfo(window, info);
}
+SDL_Thread *SDL::createThread(SDL_ThreadFunction fn,
+ const char *name, void *data)
+{
+ return SDL_CreateThread(fn, name, data);
+}
+
#endif // USE_SDL2
diff --git a/src/utils/sdl2helper.h b/src/utils/sdl2helper.h
index 5ba2d45bb..f8dd40270 100644
--- a/src/utils/sdl2helper.h
+++ b/src/utils/sdl2helper.h
@@ -24,6 +24,8 @@
#ifdef USE_SDL2
#include "utils/stringvector.h"
+#include <SDL_thread.h>
+
#include "localconsts.h"
struct SDL_Surface;
@@ -45,6 +47,9 @@ namespace SDL
void setVsync(const int val);
bool getWindowWMInfo(SDL_Window *const window, SDL_SysWMinfo *const info);
+
+ SDL_Thread *createThread(SDL_ThreadFunction fn,
+ const char *name, void *data);
} // namespace SDL
#endif // USE_SDL2
diff --git a/src/utils/sdlhelper.cpp b/src/utils/sdlhelper.cpp
index ed2187172..5b640f570 100644
--- a/src/utils/sdlhelper.cpp
+++ b/src/utils/sdlhelper.cpp
@@ -95,4 +95,10 @@ bool SDL::getWindowWMInfo(SDL_Surface *const window A_UNUSED,
return SDL_GetWMInfo(info);
}
+SDL_Thread *SDL::createThread(SDL_ThreadFunction fn,
+ const char *name A_UNUSED, void *data)
+{
+ return SDL_CreateThread(fn, data);
+}
+
#endif // USE_SDL2
diff --git a/src/utils/sdlhelper.h b/src/utils/sdlhelper.h
index 27d5cc2ab..e09e05b7b 100644
--- a/src/utils/sdlhelper.h
+++ b/src/utils/sdlhelper.h
@@ -27,6 +27,8 @@
#else
#include "utils/stringvector.h"
+#include <SDL_thread.h>
+
#include "localconsts.h"
struct SDL_Surface;
@@ -50,6 +52,9 @@ namespace SDL
bool getWindowWMInfo(SDL_Surface *const window A_UNUSED,
SDL_SysWMinfo *const info);
+
+ SDL_Thread *createThread(SDL_ThreadFunction fn,
+ const char *name A_UNUSED, void *data);
} // namespace SDL
#endif // USE_SDL2