summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/common/entry/entry.h
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2017-12-01 13:22:27 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2017-12-01 13:22:27 +0100
commit39176274946d70ff520f265dee8fbd16d5fe0000 (patch)
tree318801d93146752050c9a492654ae3738820e3b9 /3rdparty/bgfx/examples/common/entry/entry.h
parent6829ecb3b037d6bfbe0b84e818d17d712f71bce6 (diff)
Updated GENie, BGFX, BX, added BIMG since it is separated now, updated all shader binaries and MAME part of code to support new interfaces [Miodrag Milanovic]
Diffstat (limited to '3rdparty/bgfx/examples/common/entry/entry.h')
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry.h70
1 files changed, 41 insertions, 29 deletions
diff --git a/3rdparty/bgfx/examples/common/entry/entry.h b/3rdparty/bgfx/examples/common/entry/entry.h
index cfdfd25dd81..9efe7c672aa 100644
--- a/3rdparty/bgfx/examples/common/entry/entry.h
+++ b/3rdparty/bgfx/examples/common/entry/entry.h
@@ -18,12 +18,21 @@ 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); \
- }
+#ifndef ENTRY_CONFIG_IMPLEMENT_MAIN
+# define ENTRY_CONFIG_IMPLEMENT_MAIN 0
+#endif // ENTRY_CONFIG_IMPLEMENT_MAIN
+
+#if ENTRY_CONFIG_IMPLEMENT_MAIN
+#define ENTRY_IMPLEMENT_MAIN(_app, _name, _description) \
+ int _main_(int _argc, char** _argv) \
+ { \
+ _app app(_name, _description); \
+ return entry::runApp(&app, _argc, _argv); \
+ }
+#else
+#define ENTRY_IMPLEMENT_MAIN(_app, _name, _description) \
+ _app s_ ## _app ## App(_name, _description)
+#endif // ENTRY_CONFIG_IMPLEMENT_MAIN
namespace entry
{
@@ -267,45 +276,48 @@ namespace entry
bool processWindowEvents(WindowState& _state, uint32_t& _debug, uint32_t& _reset);
- struct BX_NO_VTABLE AppI
+ class BX_NO_VTABLE AppI
{
+ public:
+ ///
+ AppI(const char* _name, const char* _description);
+
+ ///
virtual ~AppI() = 0;
- virtual void init(int _argc, char** _argv) = 0;
+
+ ///
+ virtual void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) = 0;
+
+ ///
virtual int shutdown() = 0;
- virtual bool update() = 0;
- };
- inline AppI::~AppI()
- {
- }
+ ///
+ virtual bool update() = 0;
- class App : public AppI
- {
- public:
- App(const char* _name);
+ ///
+ const char* getName() const;
- virtual ~App();
+ ///
+ const char* getDescription() const;
- const char* getName() const
- {
- return m_name;
- }
+ ///
+ AppI* getNext();
- AppI* getNext()
- {
- return m_next;
- }
+ AppI* m_next;
private:
const char* m_name;
- App* m_next;
+ const char* m_description;
};
///
- App* getFirstApp();
+ AppI* getFirstApp();
+
+ ///
+ uint32_t getNumApps();
///
- int runApp(AppI* _app, int _argc, char** _argv);
+ int runApp(AppI* _app, int _argc, const char* const* _argv);
} // namespace entry