diff options
Diffstat (limited to '3rdparty/bgfx/examples/common/entry/entry_x11.cpp')
-rw-r--r-- | 3rdparty/bgfx/examples/common/entry/entry_x11.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/3rdparty/bgfx/examples/common/entry/entry_x11.cpp b/3rdparty/bgfx/examples/common/entry/entry_x11.cpp index 7016b8b640f..78e4306eb2d 100644 --- a/3rdparty/bgfx/examples/common/entry/entry_x11.cpp +++ b/3rdparty/bgfx/examples/common/entry/entry_x11.cpp @@ -20,7 +20,8 @@ #include <bx/thread.h> #include <bx/os.h> #include <bx/handlealloc.h> -#include <string.h> // memset +#include <bx/mutex.h> + #include <string> #include <fcntl.h> @@ -107,7 +108,7 @@ namespace entry { m_fd = open("/dev/input/js0", O_RDONLY | O_NONBLOCK); - memset(m_value, 0, sizeof(m_value) ); + bx::memSet(m_value, 0, sizeof(m_value) ); // Deadzone values from xinput.h m_deadzone[GamepadAxis::LeftX ] = @@ -250,7 +251,7 @@ namespace entry : m_modifiers(Modifier::None) , m_exit(false) { - memset(s_translateKey, 0, sizeof(s_translateKey) ); + bx::memSet(s_translateKey, 0, sizeof(s_translateKey) ); initTranslateKey(XK_Escape, Key::Esc); initTranslateKey(XK_Return, Key::Return); initTranslateKey(XK_Tab, Key::Tab); @@ -352,7 +353,7 @@ namespace entry m_visual = DefaultVisual(m_display, screen); m_root = RootWindow(m_display, screen); - memset(&m_windowAttrs, 0, sizeof(m_windowAttrs) ); + bx::memSet(&m_windowAttrs, 0, sizeof(m_windowAttrs) ); m_windowAttrs.background_pixmap = 0; m_windowAttrs.border_pixel = 0; m_windowAttrs.event_mask = 0 @@ -379,7 +380,7 @@ namespace entry // Clear window to black. XSetWindowAttributes attr; - memset(&attr, 0, sizeof(attr) ); + bx::memSet(&attr, 0, sizeof(attr) ); XChangeWindowAttributes(m_display, m_window[0], CWBackPixel, &attr); const char* wmDeleteWindowName = "WM_DELETE_WINDOW"; @@ -605,7 +606,7 @@ namespace entry // Clear window to black. XSetWindowAttributes attr; - memset(&attr, 0, sizeof(attr) ); + bx::memSet(&attr, 0, sizeof(attr) ); XChangeWindowAttributes(m_display, window, CWBackPixel, &attr); const char* wmDeleteWindowName = "WM_DELETE_WINDOW"; @@ -639,7 +640,7 @@ namespace entry WindowHandle findHandle(Window _window) { - bx::LwMutexScope scope(m_lock); + bx::MutexScope scope(m_lock); for (uint32_t ii = 0, num = m_windowAlloc.getNumHandles(); ii < num; ++ii) { uint16_t idx = m_windowAlloc.getHandleAt(ii); @@ -662,7 +663,7 @@ namespace entry int32_t m_mz; EventQueue m_eventQueue; - bx::LwMutex m_lock; + bx::Mutex m_lock; bx::HandleAllocT<ENTRY_CONFIG_MAX_WINDOWS> m_windowAlloc; int32_t m_depth; @@ -703,7 +704,7 @@ namespace entry WindowHandle createWindow(int32_t _x, int32_t _y, uint32_t _width, uint32_t _height, uint32_t _flags, const char* _title) { - bx::LwMutexScope scope(s_ctx.m_lock); + bx::MutexScope scope(s_ctx.m_lock); WindowHandle handle = { s_ctx.m_windowAlloc.alloc() }; if (isValid(handle) ) @@ -729,7 +730,7 @@ namespace entry XUnmapWindow(s_ctx.m_display, s_ctx.m_window[_handle.idx]); XDestroyWindow(s_ctx.m_display, s_ctx.m_window[_handle.idx]); - bx::LwMutexScope scope(s_ctx.m_lock); + bx::MutexScope scope(s_ctx.m_lock); s_ctx.m_windowAlloc.free(_handle.idx); } } |