summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/common/entry/entry.h
diff options
context:
space:
mode:
author ImJezze <jezze@gmx.net>2015-10-20 21:34:36 +0200
committer ImJezze <jezze@gmx.net>2015-10-20 21:34:36 +0200
commita7b8acbe3eebcf17367baa642375cfa47ae4ea85 (patch)
tree854b859d6176802c0278f4b00de3f7c774e02dda /3rdparty/bgfx/examples/common/entry/entry.h
parent4610935e796661874bb4ee7ec6536d9423aeb7be (diff)
parent74aae76c4e3e257f99d139c4febb5d86d1419e50 (diff)
Merge pull request #6 from mamedev/master
Sync to base master
Diffstat (limited to '3rdparty/bgfx/examples/common/entry/entry.h')
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry.h51
1 files changed, 49 insertions, 2 deletions
diff --git a/3rdparty/bgfx/examples/common/entry/entry.h b/3rdparty/bgfx/examples/common/entry/entry.h
index be1d35d75a2..13b85262067 100644
--- a/3rdparty/bgfx/examples/common/entry/entry.h
+++ b/3rdparty/bgfx/examples/common/entry/entry.h
@@ -18,6 +18,13 @@ extern "C" int _main_(int _argc, char** _argv);
#define ENTRY_WINDOW_FLAG_ASPECT_RATIO UINT32_C(0x00000001)
#define ENTRY_WINDOW_FLAG_FRAME UINT32_C(0x00000002)
+#define ENTRY_IMPLEMENT_MAIN(_app) \
+ int _main_(int _argc, char** _argv) \
+ { \
+ _app app; \
+ return entry::runApp(&app, _argc, _argv); \
+ }
+
namespace entry
{
struct WindowHandle { uint16_t idx; };
@@ -84,13 +91,24 @@ namespace entry
Down,
Left,
Right,
- PageUp,
- PageDown,
+ Insert,
+ Delete,
Home,
End,
+ PageUp,
+ PageDown,
Print,
Plus,
Minus,
+ LeftBracket,
+ RightBracket,
+ Semicolon,
+ Quote,
+ Comma,
+ Period,
+ Slash,
+ Backslash,
+ Tilde,
F1,
F2,
F3,
@@ -170,6 +188,21 @@ namespace entry
};
};
+ struct Suspend
+ {
+ enum Enum
+ {
+ WillSuspend,
+ DidSuspend,
+ WillResume,
+ DidResume,
+
+ Count
+ };
+ };
+
+ const char* getName(Key::Enum _key);
+
struct MouseState
{
MouseState()
@@ -231,6 +264,20 @@ namespace entry
bool processWindowEvents(WindowState& _state, uint32_t& _debug, uint32_t& _reset);
+ struct BX_NO_VTABLE AppI
+ {
+ virtual ~AppI() = 0;
+ virtual void init(int _argc, char** _argv) = 0;
+ virtual int shutdown() = 0;
+ virtual bool update() = 0;
+ };
+
+ inline AppI::~AppI()
+ {
+ }
+
+ int runApp(AppI* _app, int _argc, char** _argv);
+
} // namespace entry
#endif // ENTRY_H_HEADER_GUARD