Move USleep to utils/

This commit is contained in:
Corentin Wallez
2017-07-17 17:13:57 -04:00
committed by Corentin Wallez
parent 2fbda87caf
commit 134e08005a
19 changed files with 94 additions and 37 deletions

View File

@@ -16,15 +16,6 @@
#include "utils/BackendBinding.h"
#include "wire/TerribleCommandBuffer.h"
// Include Windows.h before GLFW to avoid a redefinition of APIENTRY
#if defined(NXT_PLATFORM_WINDOWS)
#include <Windows.h>
#elif defined(NXT_PLATFORM_POSIX)
#include <unistd.h>
#else
#error "Unsupported platform."
#endif
#include <nxt/nxt.h>
#include <nxt/nxtcpp.h>
#include "GLFW/glfw3.h"
@@ -179,18 +170,6 @@ void DoSwapBuffers() {
binding->SwapBuffers();
}
#if defined(NXT_PLATFORM_WINDOWS)
void USleep(uint64_t usecs) {
Sleep(static_cast<DWORD>(usecs / 1000));
}
#elif defined(NXT_PLATFORM_POSIX)
void USleep(uint64_t usecs) {
usleep(usecs);
}
#else
#error "Implement USleep for your platform."
#endif
bool ShouldQuit() {
return glfwWindowShouldClose(window);
}