File tree 5 files changed +20
-5
lines changed
5 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,10 @@ int main(int argc, char* argv[]) {
114
114
const std::size_t window_width = 800u ;
115
115
const std::size_t window_height = 600u ;
116
116
117
- if (SDL_Init (SDL_INIT_VIDEO) != 0 ) {
117
+ // Prevent SDL from capturing Ctrl+C SIGINT
118
+ SDL_SetHint (SDL_HINT_NO_SIGNAL_HANDLERS, " 1" );
119
+
120
+ if (SDL_Init (SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) != 0 ) {
118
121
throw gui::exception (
119
122
" SDL_Init" , " Could not initialise SDL: " + std::string (SDL_GetError ()) + " ." );
120
123
}
Original file line number Diff line number Diff line change @@ -54,7 +54,10 @@ int main(int argc, char* argv[]) {
54
54
const std::size_t window_width = 800u ;
55
55
const std::size_t window_height = 600u ;
56
56
57
- if (SDL_Init (SDL_INIT_VIDEO) != 0 ) {
57
+ // Prevent SDL from capturing Ctrl+C SIGINT
58
+ SDL_SetHint (SDL_HINT_NO_SIGNAL_HANDLERS, " 1" );
59
+
60
+ if (SDL_Init (SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) != 0 ) {
58
61
throw gui::exception (
59
62
" SDL_Init" , " Could not initialise SDL: " + std::string (SDL_GetError ()) + " ." );
60
63
}
Original file line number Diff line number Diff line change @@ -97,7 +97,10 @@ int main(int argc, char* argv[]) {
97
97
const std::size_t window_width = 800u ;
98
98
const std::size_t window_height = 600u ;
99
99
100
- if (SDL_Init (SDL_INIT_VIDEO) != 0 ) {
100
+ // Prevent SDL from capturing Ctrl+C SIGINT
101
+ SDL_SetHint (SDL_HINT_NO_SIGNAL_HANDLERS, " 1" );
102
+
103
+ if (SDL_Init (SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) != 0 ) {
101
104
throw gui::exception (
102
105
" SDL_Init" , " Could not initialise SDL: " + std::string (SDL_GetError ()) + " ." );
103
106
}
Original file line number Diff line number Diff line change @@ -35,7 +35,10 @@ int main(int argc, char* argv[]) {
35
35
const std::size_t window_width = 800u ;
36
36
const std::size_t window_height = 600u ;
37
37
38
- if (SDL_Init (SDL_INIT_VIDEO) != 0 ) {
38
+ // Prevent SDL from capturing Ctrl+C SIGINT
39
+ SDL_SetHint (SDL_HINT_NO_SIGNAL_HANDLERS, " 1" );
40
+
41
+ if (SDL_Init (SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) != 0 ) {
39
42
throw gui::exception (
40
43
" SDL_Init" , " Could not initialise SDL: " + std::string (SDL_GetError ()) + " ." );
41
44
}
Original file line number Diff line number Diff line change @@ -276,7 +276,10 @@ int main(int /*argc*/, char* /*argv*/[]) {
276
276
#if defined(GLSFML_GUI)
277
277
sf::Window window;
278
278
#elif defined(SDL_GUI) || defined(GLSDL_GUI)
279
- if (SDL_Init (SDL_INIT_VIDEO) != 0 ) {
279
+ // Prevent SDL from capturing Ctrl+C SIGINT
280
+ SDL_SetHint (SDL_HINT_NO_SIGNAL_HANDLERS, " 1" );
281
+
282
+ if (SDL_Init (SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) != 0 ) {
280
283
throw gui::exception (
281
284
" SDL_Init" , " Could not initialise SDL: " + std::string (SDL_GetError ()) + " ." );
282
285
}
You can’t perform that action at this time.
0 commit comments