diff --git a/examples/common/entry/entry_sdl.cpp b/examples/common/entry/entry_sdl.cpp index 91bfef74..d8ba1b47 100644 --- a/examples/common/entry/entry_sdl.cpp +++ b/examples/common/entry/entry_sdl.cpp @@ -320,7 +320,7 @@ namespace entry initTranslateGamepadAxis(SDL_CONTROLLER_AXIS_TRIGGERRIGHT, GamepadAxis::RightZ); } - void run(int _argc, char** _argv) + int run(int _argc, char** _argv) { m_mte.m_argc = _argc; m_mte.m_argv = _argv; @@ -710,6 +710,8 @@ namespace entry SDL_DestroyWindow(m_window[0]); SDL_Quit(); + + return m_thread.getExitCode(); } WindowHandle findHandle(uint32_t _windowId) @@ -896,8 +898,7 @@ namespace entry int main(int _argc, char** _argv) { using namespace entry; - s_ctx.run(_argc, _argv); - return 0; + return s_ctx.run(_argc, _argv); } #endif // ENTRY_CONFIG_USE_SDL diff --git a/examples/common/entry/entry_windows.cpp b/examples/common/entry/entry_windows.cpp index 26f496d6..376ce8ac 100644 --- a/examples/common/entry/entry_windows.cpp +++ b/examples/common/entry/entry_windows.cpp @@ -499,7 +499,7 @@ namespace entry s_xinput.shutdown(); - return 0; + return thread.getExitCode(); } LRESULT process(HWND _hwnd, UINT _id, WPARAM _wparam, LPARAM _lparam) diff --git a/examples/common/entry/entry_x11.cpp b/examples/common/entry/entry_x11.cpp index 44a501e7..ff1768c7 100644 --- a/examples/common/entry/entry_x11.cpp +++ b/examples/common/entry/entry_x11.cpp @@ -477,7 +477,7 @@ namespace entry XUnmapWindow(m_display, m_window[0]); XDestroyWindow(m_display, m_window[0]); - return EXIT_SUCCESS; + return thread.getExitCode(); } void setModifier(Modifier::Enum _modifier, bool _set)