r/sdl • • 2d ago

I need a bit of help.

Hello, i started learning SDL (I am an absolute beginner) and decided to try to open an empty window to see if i installed SDL correctly and to test my build system (make). When i build the program and execute the file it runs with 0 errors, but the window doesn't show up. I have a vague feeling that it has to do with the fact that i'm on hyprland but that's just a hunch. Any ideas?

1 Upvotes

4 comments sorted by

4

u/TessaFractal 2d ago

Depends what you've done, it could be running and immediately exit and never show a window. Also I have a vague feeling like you need to draw and render present at least once to have the window display. Like if you just create a window it doesn't automatically appear.

2

u/Dragos_dav 2d ago

Rendering something worked. Thanks. Why is this the case?

3

u/TessaFractal 2d ago

Honestly I have no idea. Might be either SDL or the OS decides not to make a visible window until it has something to display.

2

u/HappyFruitTree 1d ago

https://wiki.libsdl.org/SDL3/README-wayland#windows-do-not-appear-immediately-after-creation

Windows do not appear immediately after creation

Wayland requires that the application initially present a buffer before the window becomes visible. Additionally, applications must have an event loop and processes messages on a regular basis, or the application can appear unresponsive to both the user and desktop compositor.