summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/common/entry
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/examples/common/entry')
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry.cpp2
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_noop.cpp (renamed from 3rdparty/bgfx/examples/common/entry/entry_qnx.cpp)4
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_p.h5
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_sdl.cpp4
-rw-r--r--3rdparty/bgfx/examples/common/entry/input.cpp7
5 files changed, 15 insertions, 7 deletions
diff --git a/3rdparty/bgfx/examples/common/entry/entry.cpp b/3rdparty/bgfx/examples/common/entry/entry.cpp
index 1fb0497be85..03cf82b5373 100644
--- a/3rdparty/bgfx/examples/common/entry/entry.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry.cpp
@@ -6,7 +6,7 @@
#include <bx/bx.h>
#include <bgfx/bgfx.h>
#include <bx/string.h>
-#include <bx/readerwriter.h>
+#include <bx/crtimpl.h>
#include <time.h>
diff --git a/3rdparty/bgfx/examples/common/entry/entry_qnx.cpp b/3rdparty/bgfx/examples/common/entry/entry_noop.cpp
index af91ca7db40..c6544595229 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_qnx.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_noop.cpp
@@ -5,7 +5,7 @@
#include "entry_p.h"
-#if ENTRY_CONFIG_USE_NATIVE && BX_PLATFORM_QNX
+#if ENTRY_CONFIG_USE_NOOP
#include <stdio.h>
@@ -76,4 +76,4 @@ int main(int _argc, char** _argv)
entry::main(_argc, _argv);
}
-#endif // ENTRY_CONFIG_USE_NATIVE && BX_PLATFORM_QNX
+#endif // ENTRY_CONFIG_USE_NOOP
diff --git a/3rdparty/bgfx/examples/common/entry/entry_p.h b/3rdparty/bgfx/examples/common/entry/entry_p.h
index 502eed673ad..f44a421946a 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_p.h
+++ b/3rdparty/bgfx/examples/common/entry/entry_p.h
@@ -13,6 +13,10 @@
#include "entry.h"
#include <string.h> // memcpy
+#ifndef ENTRY_CONFIG_USE_NOOP
+# define ENTRY_CONFIG_USE_NOOP (BX_PLATFORM_QNX || BX_PLATFORM_XBOXONE)
+#endif // ENTRY_CONFIG_USE_NOOP
+
#ifndef ENTRY_CONFIG_USE_SDL
# define ENTRY_CONFIG_USE_SDL BX_PLATFORM_STEAMLINK
#endif // ENTRY_CONFIG_USE_SDL
@@ -22,6 +26,7 @@
#endif // ENTRY_CONFIG_USE_GLFW
#if !defined(ENTRY_CONFIG_USE_NATIVE) \
+ && !ENTRY_CONFIG_USE_NOOP \
&& !ENTRY_CONFIG_USE_SDL \
&& !ENTRY_CONFIG_USE_GLFW
# define ENTRY_CONFIG_USE_NATIVE 1
diff --git a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
index 989d0ae0667..07193b83ca7 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
@@ -29,6 +29,7 @@ BX_PRAGMA_DIAGNOSTIC_POP_CLANG()
#include <bx/thread.h>
#include <bx/handlealloc.h>
#include <bx/readerwriter.h>
+#include <bx/crtimpl.h>
#include <tinystl/allocator.h>
#include <tinystl/string.h>
@@ -219,7 +220,7 @@ namespace entry
# elif BX_PLATFORM_WINDOWS
return wmi.info.win.window;
# elif BX_PLATFORM_STEAMLINK
- return wmi.info.vivante.window;
+ return wmi.info.vivante.window;
# endif // BX_PLATFORM_
}
@@ -307,6 +308,7 @@ namespace entry
initTranslateKey(SDL_SCANCODE_PRINTSCREEN, Key::Print);
initTranslateKey(SDL_SCANCODE_KP_PLUS, Key::Plus);
initTranslateKey(SDL_SCANCODE_KP_MINUS, Key::Minus);
+ initTranslateKey(SDL_SCANCODE_GRAVE, Key::Tilde);
initTranslateKey(SDL_SCANCODE_F1, Key::F1);
initTranslateKey(SDL_SCANCODE_F2, Key::F2);
initTranslateKey(SDL_SCANCODE_F3, Key::F3);
diff --git a/3rdparty/bgfx/examples/common/entry/input.cpp b/3rdparty/bgfx/examples/common/entry/input.cpp
index c0d2686d293..bb9925990b0 100644
--- a/3rdparty/bgfx/examples/common/entry/input.cpp
+++ b/3rdparty/bgfx/examples/common/entry/input.cpp
@@ -11,6 +11,7 @@
#include <bx/allocator.h>
#include <bx/ringbuffer.h>
+#include <tinystl/string.h>
#include <tinystl/allocator.h>
#include <tinystl/unordered_map.h>
namespace stl = tinystl;
@@ -197,12 +198,12 @@ struct Input
void addBindings(const char* _name, const InputBinding* _bindings)
{
- m_inputBindingsMap.insert(stl::make_pair(_name, _bindings) );
+ m_inputBindingsMap.insert(stl::make_pair(stl::string(_name), _bindings) );
}
void removeBindings(const char* _name)
{
- InputBindingMap::iterator it = m_inputBindingsMap.find(_name);
+ InputBindingMap::iterator it = m_inputBindingsMap.find(stl::string(_name));
if (it != m_inputBindingsMap.end() )
{
m_inputBindingsMap.erase(it);
@@ -275,7 +276,7 @@ struct Input
}
}
- typedef stl::unordered_map<const char*, const InputBinding*> InputBindingMap;
+ typedef stl::unordered_map<stl::string, const InputBinding*> InputBindingMap;
InputBindingMap m_inputBindingsMap;
Mouse m_mouse;
Keyboard m_keyboard;