Skip to content

Commit 9c887c0

Browse files
committed
Focus window not required
1 parent 7b1c6c5 commit 9c887c0

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

source/InputGatherer.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,17 @@ InputGatherer::InputGatherer(InputSDL* producer, const Neat& descriptor)
2424
SDL_WINDOW_BORDERLESS | SDL_WINDOW_INPUT_FOCUS
2525
);
2626

27-
LANGULUS_ASSERT(mInputFocus, Construct,
28-
"SDL failed to create input window. SDL_Error: ",
29-
SDL_GetError()
30-
);
27+
if (not mInputFocus) {
28+
// We're probably running without a desktop environment
29+
Logger::Warning(Self(),
30+
"SDL failed to create input window - SDL won't be used for input. "
31+
"The gatherer can still collect input from other modules, like FTXUI or GLFW. "
32+
"SDL_Error: ", SDL_GetError()
33+
);
34+
Couple(descriptor);
35+
VERBOSE_INPUT("Initialized");
36+
return;
37+
}
3138

3239
LANGULUS_ASSERT(SDL_SetRelativeMouseMode(true) >= 0, Construct,
3340
"SDL failed to set relative mouse mode. SDL_Error: ",

0 commit comments

Comments
 (0)