diff --git a/include/TessesFramework/Common.hpp b/include/TessesFramework/Common.hpp index 11ff4d3..c3575cc 100644 --- a/include/TessesFramework/Common.hpp +++ b/include/TessesFramework/Common.hpp @@ -87,6 +87,7 @@ namespace Tesses::Framework void TF_Init(); void TF_InitWithConsole(); void TF_ConnectToSelf(uint16_t port); + void TF_InitEventLoop(); void TF_RunEventLoop(); void TF_RunEventLoopItteration(); bool TF_IsRunning(); diff --git a/src/TF_Init.cpp b/src/TF_Init.cpp index 9ceca30..d9ce2ea 100644 --- a/src/TF_Init.cpp +++ b/src/TF_Init.cpp @@ -94,6 +94,7 @@ namespace Tesses::Framework } void TF_RunEventLoop() { + TF_InitEventLoop(); while(isRunning) { TF_RunEventLoopItteration(); @@ -173,6 +174,11 @@ namespace Tesses::Framework #endif } + void TF_InitEventLoop() + { + signal(SIGINT,_sigInt); + signal(SIGTERM, _sigInt); + } void TF_Init() { @@ -221,8 +227,7 @@ if (iResult != 0) { // Initialize the default gamepad (which reads handheld mode inputs as well as the first connected controller) #else signal(SIGPIPE,SIG_IGN); - signal(SIGINT,_sigInt); - signal(SIGTERM, _sigInt); + #endif }