diff options
Diffstat (limited to '3rdparty/bgfx/examples/common/entry/entry.h')
-rw-r--r-- | 3rdparty/bgfx/examples/common/entry/entry.h | 51 |
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 |