This commit is contained in:
Branimir Karadžić 2017-06-29 22:23:18 -07:00
parent 7440bed0b8
commit 917385f79e
42 changed files with 181 additions and 140 deletions

View File

@ -20,12 +20,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_TEXT;
m_reset = BGFX_RESET_VSYNC;

View File

@ -83,14 +83,14 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
BX_UNUSED(s_cubeTriList, s_cubeTriStrip);
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -484,12 +484,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -107,12 +107,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -18,12 +18,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -67,12 +67,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -90,12 +90,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -321,12 +321,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
bgfx::init(
args.m_type

View File

@ -127,12 +127,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -145,12 +145,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -59,12 +59,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -42,12 +42,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -34,12 +34,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -513,7 +513,7 @@ static RenderState s_renderStates[RenderState::Count] =
struct ViewState
{
ViewState(uint32_t _width = 1280, uint32_t _height = 720)
ViewState(uint32_t _width = 0, uint32_t _height = 0)
: m_width(_width)
, m_height(_height)
{
@ -795,11 +795,11 @@ public:
{
}
virtual void init(int _argc, char** _argv) BX_OVERRIDE
virtual void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_viewState = ViewState(1280, 720);
m_viewState = ViewState(_width, _height);
m_clearValues = ClearValues(0x30303000, 1.0f, 0);
m_debug = BGFX_DEBUG_NONE;

View File

@ -524,7 +524,7 @@ static RenderState s_renderStates[RenderState::Count] =
struct ViewState
{
ViewState(uint32_t _width = 1280, uint32_t _height = 720)
ViewState(uint32_t _width = 0, uint32_t _height = 0)
: m_width(_width)
, m_height(_height)
{
@ -1875,11 +1875,11 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_viewState = ViewState(1280, 720);
m_viewState = ViewState(_width, _height);
m_clearValues = { 0x00000000, 1.0f, 0 };
m_debug = BGFX_DEBUG_NONE;

View File

@ -66,12 +66,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -1289,15 +1289,15 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_viewState = ViewState(uint16_t(m_width), uint16_t(m_height));
m_clearValues = ClearValues(0x00000000, 1.0f, 0);

View File

@ -91,12 +91,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_NONE;

View File

@ -489,12 +489,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = 0
| BGFX_RESET_VSYNC

View File

@ -157,12 +157,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -1241,12 +1241,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -198,12 +198,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -74,12 +74,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -42,11 +42,11 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -118,12 +118,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -13,7 +13,7 @@ uint16_t uint16_max(uint16_t _a, uint16_t _b)
return _a < _b ? _b : _a;
}
int _main_(int _argc, char** _argv)
int32_t _main_(int32_t _argc, char** _argv)
{
uint32_t width = 1280;
uint32_t height = 720;

View File

@ -70,12 +70,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -67,12 +67,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -315,12 +315,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = 0
| BGFX_RESET_VSYNC

View File

@ -37,12 +37,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC | BGFX_RESET_MSAA_X16;

View File

@ -26,12 +26,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -199,12 +199,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -235,12 +235,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -116,12 +116,12 @@ public:
{
}
void init(int _argc, char** _argv) BX_OVERRIDE
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) BX_OVERRIDE
{
Args args(_argc, _argv);
m_width = 1280;
m_height = 720;
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;

View File

@ -648,7 +648,7 @@ void meshSubmit(const Mesh* _mesh, const MeshState*const* _state, uint8_t _numPa
_mesh->submit(_state, _numPasses, _mtx, _numMatrices);
}
Args::Args(int _argc, char** _argv)
Args::Args(int _argc, const char* const* _argv)
: m_type(bgfx::RendererType::Count)
, m_pciId(BGFX_PCI_ID_NONE)
{

View File

@ -101,7 +101,7 @@ void meshSubmit(const Mesh* _mesh, const MeshState*const* _state, uint8_t _numPa
///
struct Args
{
Args(int _argc, char** _argv);
Args(int _argc, const char* const* _argv);
bgfx::RendererType::Enum m_type;
uint16_t m_pciId;

View File

@ -22,7 +22,7 @@
#define RMT_ENABLED ENTRY_CONFIG_PROFILER
#include <remotery/lib/Remotery.h>
extern "C" int _main_(int _argc, char** _argv);
extern "C" int32_t _main_(int32_t _argc, char** _argv);
namespace entry
{
@ -277,10 +277,10 @@ BX_PRAGMA_DIAGNOSTIC_POP();
if (_argc > 1)
{
inputSetMouseLock(_argc > 1 ? bx::toBool(_argv[1]) : !inputIsMouseLocked() );
return 0;
return bx::kExitSuccess;
}
return 1;
return bx::kExitFailure;
}
int cmdGraphics(CmdContext* /*_context*/, void* /*_userData*/, int _argc, char const* const* _argv)
@ -299,7 +299,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|| setOrToggle(s_reset, "depthclamp", BGFX_RESET_DEPTH_CLAMP, 1, _argc, _argv)
)
{
return 0;
return bx::kExitSuccess;
}
else if (setOrToggle(s_debug, "stats", BGFX_DEBUG_STATS, 1, _argc, _argv)
|| setOrToggle(s_debug, "ifh", BGFX_DEBUG_IFH, 1, _argc, _argv)
@ -307,7 +307,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|| setOrToggle(s_debug, "wireframe", BGFX_DEBUG_WIREFRAME, 1, _argc, _argv) )
{
bgfx::setDebug(s_debug);
return 0;
return bx::kExitSuccess;
}
else if (0 == bx::strCmp(_argv[1], "screenshot") )
{
@ -327,23 +327,23 @@ BX_PRAGMA_DIAGNOSTIC_POP();
bgfx::requestScreenShot(fbh, filePath);
}
return 0;
return bx::kExitSuccess;
}
else if (0 == bx::strCmp(_argv[1], "fullscreen") )
{
WindowHandle window = { 0 };
toggleFullscreen(window);
return 0;
return bx::kExitSuccess;
}
}
return 1;
return bx::kExitFailure;
}
int cmdExit(CmdContext* /*_context*/, void* /*_userData*/, int /*_argc*/, char const* const* /*_argv*/)
{
s_exit = true;
return 0;
return bx::kExitSuccess;
}
static const InputBinding s_bindings[] =
@ -379,9 +379,47 @@ BX_PRAGMA_DIAGNOSTIC_POP();
}
#endif // BX_PLATFORM_EMSCRIPTEN
static AppI* s_apps = NULL;
static uint32_t s_numApps = 0;
static char s_restartArgs[1024] = { '\0' };
static AppI* s_currentApp = NULL;
static AppI* s_apps = NULL;
static uint32_t s_numApps = 0;
static char s_restartArgs[1024] = { '\0' };
int cmdApp(CmdContext* /*_context*/, void* /*_userData*/, int _argc, char const* const* _argv)
{
if (0 == bx::strCmp(_argv[1], "restart")
&& NULL != s_currentApp)
{
if (1 == _argc)
{
bx::strCopy(s_restartArgs, BX_COUNTOF(s_restartArgs), s_currentApp->getName() );
return bx::kExitSuccess;
}
if (0 == bx::strCmp(_argv[2], "next") )
{
AppI* next = s_currentApp->getNext();
if (NULL == next)
{
next = getFirstApp();
}
bx::strCopy(s_restartArgs, BX_COUNTOF(s_restartArgs), next->getName() );
return bx::kExitSuccess;
}
for (AppI* app = getFirstApp(); NULL != app; app = app->getNext() )
{
if (0 == bx::strCmp(_argv[2], app->getName() ) )
{
bx::strCopy(s_restartArgs, BX_COUNTOF(s_restartArgs), app->getName() );
return bx::kExitSuccess;
}
}
}
return bx::kExitFailure;
}
AppI::AppI(const char* _name, const char* _description)
{
@ -418,14 +456,9 @@ BX_PRAGMA_DIAGNOSTIC_POP();
return s_numApps;
}
void setRestartArgs(const char* _args)
int runApp(AppI* _app, int _argc, const char* const* _argv)
{
bx::strCopy(s_restartArgs, BX_COUNTOF(s_restartArgs), _args);
}
int runApp(AppI* _app, int _argc, char** _argv)
{
_app->init(_argc, _argv);
_app->init(_argc, _argv, ENTRY_DEFAULT_WIDTH, ENTRY_DEFAULT_HEIGHT);
bgfx::frame();
WindowHandle defaultWindow = { 0 };
@ -435,7 +468,13 @@ BX_PRAGMA_DIAGNOSTIC_POP();
s_app = _app;
emscripten_set_main_loop(&updateApp, -1, 1);
#else
while (_app->update() );
while (_app->update() )
{
if (0 != bx::strLen(s_restartArgs) )
{
break;
}
}
#endif // BX_PLATFORM_EMSCRIPTEN
return _app->shutdown();
@ -476,7 +515,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
BX_FREE(g_allocator, apps);
}
int main(int _argc, char** _argv)
int main(int _argc, const char* const* _argv)
{
//DBG(BX_COMPILER_NAME " / " BX_CPU_NAME " / " BX_ARCH_NAME " / " BX_PLATFORM_NAME);
@ -510,6 +549,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
cmdAdd("mouselock", cmdMouseLock);
cmdAdd("graphics", cmdGraphics );
cmdAdd("exit", cmdExit );
cmdAdd("app", cmdApp );
inputInit();
inputAddBindings("bindings", s_bindings);
@ -549,11 +589,12 @@ restart:
s_restartArgs[0] = '\0';
if (0 == s_numApps)
{
result = ::_main_(_argc, _argv);
result = ::_main_(_argc, (char**)_argv);
}
else
{
result = runApp(NULL == selected ? getFirstApp() : selected, _argc, _argv);
s_currentApp = NULL == selected ? getFirstApp() : selected;
result = runApp(s_currentApp, _argc, _argv);
}
if (0 != bx::strLen(s_restartArgs) )

View File

@ -286,7 +286,7 @@ namespace entry
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;
@ -321,10 +321,7 @@ namespace entry
uint32_t getNumApps();
///
void setRestartArgs(const char* _args);
///
int runApp(AppI* _app, int _argc, char** _argv);
int runApp(AppI* _app, int _argc, const char* const* _argv);
} // namespace entry

View File

@ -228,7 +228,7 @@ namespace entry
struct MainThreadEntry
{
int m_argc;
char** m_argv;
const char* const* m_argv;
static int32_t threadFunc(void* _userData);
};
@ -393,7 +393,7 @@ namespace entry
s_translateKey[GLFW_KEY_Z] = Key::KeyZ;
}
int run(int _argc, char** _argv)
int run(int _argc, const char* const* _argv)
{
m_mte.m_argc = _argc;
m_mte.m_argv = _argv;
@ -852,7 +852,7 @@ namespace entry
}
}
int main(int _argc, char** _argv)
int main(int _argc, const char* const* _argv)
{
using namespace entry;
return s_ctx.run(_argc, _argv);

View File

@ -67,7 +67,7 @@ namespace entry
static void static_deallocate(void* _ptr, size_t /*_bytes*/);
};
int main(int _argc, char** _argv);
int main(int _argc, const char* const* _argv);
char keyToAscii(Key::Enum _key, uint8_t _modifiers);

View File

@ -220,8 +220,8 @@ namespace entry
struct MainThreadEntry
{
int m_argc;
char** m_argv;
int32_t m_argc;
const char* const* m_argv;
static int32_t threadFunc(void* _userData);
};
@ -343,7 +343,7 @@ namespace entry
m_mz = 0;
}
int32_t run(int _argc, char** _argv)
int32_t run(int _argc, const char* const* _argv)
{
XInitThreads();
m_display = XOpenDisplay(0);
@ -773,7 +773,7 @@ namespace entry
} // namespace entry
int main(int _argc, char** _argv)
int main(int _argc, const char* const* _argv)
{
using namespace entry;
return s_ctx.run(_argc, _argv);

View File

@ -5,6 +5,8 @@
#include "imgui/imgui.h"
#include "entry/entry.h"
#include "entry/cmd.h"
#include <bx/string.h>
bool showExampleDialog(entry::AppI* _app)
{
@ -45,8 +47,9 @@ bool showExampleDialog(entry::AppI* _app)
if (1 < num
&& ImGui::Combo("Example", &current, items, num) )
{
entry::setRestartArgs(items[current]);
restart = true;
char command[1024];
bx::snprintf(command, BX_COUNTOF(command), "app restart %s", items[current]);
cmdExec(command);
}
}