-
-
Notifications
You must be signed in to change notification settings - Fork 623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDL GUI backend #1251
base: main
Are you sure you want to change the base?
SDL GUI backend #1251
Conversation
✅ Deploy Preview for conkyweb canceled.
|
8f1477e
to
cca610b
Compare
Just rebased, had to change some |
That could work, though it seems messy. There's also |
The recent changes on color stuff just got rid of the |
And we have colors :-) |
Hi, I changed how registration of output displays works to avoid linker magic, you can check out how other backends are registered on Main differences are:
|
Rebased, updated to last renaming, and should be up to @Caellian 's changes too. |
991a97c
to
c25df8a
Compare
(of course, pushing from wrong machine…) |
We might want to have a background color.
Since we always draw in our own window just subtract these.
Not sure why the Nix build is failing, but it's fine to ignore it for now. |
Hmm probably something similar with how we accept GUI settings or not. Btw, it fails to build on Haiku because |
Just to make sure, you might want to trace calls to |
Is there any reason we can't use SDL2 rather than 1.2? It seems like SDL 1.2 isn't as well supported by the distros. Ubuntu doesn't appear to have SDL_ttf 1.2: https://packages.ubuntu.com/search?suite=noble&arch=any&searchon=names&keywords=libsdl-ttf |
FWIW there's a decent migration guide here: https://wiki.libsdl.org/SDL2/MigrationGuide |
Yes, the idea is to run on very old OSes like Atari MiNT. |
Ah, right, I see now that's in your original comment, but I had forgotten about it. The SDL_ttf library is pretty tiny, I think we could just bundle it as a 3rd party source. It's literally just 2 source files ( |
One more thought: maybe we should make it more clear that we intentionally only support SDL 1.2, so that in the future we can support newer versions as well. |
Actually, this isn't as easy as I thought. SDL_ttf 1.2 depends on freetype 1, which is also somewhat deprecated. At this point, I think it's better to just not support distros that don't ship with SDL1.2, or people can compile SDL1.2 (and its dependencies) themselves if they really want it in a modern distro that doesn't include all the SDL1.2 deps. |
I suppose we could support both with some |
This is less than ideal. It becomes really hard to maintain, and there are already a million different build options as it is. I'd prefer to keep it simple, and since GitHub actions uses Ubuntu by default for the Linux CI, it would be good to make it compile on Ubuntu (and macOS too if possible). At least that way we can catch compiler errors. Getting it to compile with Nix and macOS is pretty easy, but Ubuntu is a pain. Doing it in Docker would work, but I don't love that. I guess we could use the ExternalProject feature of CMake, then it wouldn't be too hard to include both freetype 1 and SDL_ttf 1.2 as 3rdparty dependencies. While I don't like including 3rdparty code this way, in this case it makes some sense. |
Or just have a separate sdl2 display. |
The idea is to be able to run Conky on ancient OSes and hardware (thinking about MiNT (not the GNU/Linux distro, the Atari OS) or AmigaOS), in a regular window but with minimal coding required, and also to allow testing the GUI backend without X11. I used SDL 1.2 because SDL2 only runs on Windows, OSX and Linux, which limits the interest for old platforms.
For now it only draws text with a hardcoded font. It also still needs to be compiled with X11 due to some variables here and there.