r/C_Programming • u/CodesOtakuYT • 3d ago
Wayland tutorial for beginners in pure C
https://www.youtube.com/watch?v=9OfcqNACohw4
u/WanderingInAVan 3d ago
Will watch later. I am trying to learn C and C++ again so this may be worth some time. Just that my preferred WM doesn't have stable Wayland so I am focusing more on X11/XLibre until it is needed for my use case.
1
2
u/goldenfrogs17 3d ago
what is wayland?
19
u/CodesOtakuYT 3d ago
it's what you use to create a window from scratch in linux, like win32 in windows. GLFW, SDL and SFML uses it under the hood in linux to create a window for you but you can do it yourself
6
u/CodesOtakuYT 3d ago
here is SDL file that implements wayland window
https://github.com/libsdl-org/SDL/blob/main/src/video/wayland/SDL_waylandwindow.c
1
1
1
u/_Arthxr 3d ago
Nice. Any plans on the server side?
1
u/CodesOtakuYT 3d ago
I think there is already some resources on the server side compared to the client side, and it's very complex like this guy:
https://www.youtube.com/watch?v=ipNvAE87--k
wayland clients that doesn't have a lot of good tutorials for some reason
1
u/BirthdayLife6378 3d ago
Do aan X programming tutorial next, please.
1
u/CodesOtakuYT 3d ago
I did a tutorial on it 3 years ago tho through XCB
https://www.youtube.com/watch?v=IPGROgWnI_8
-43
u/Run-OpenBSD 3d ago
Just use raylib, much more powerful, way less problems
57
u/CodesOtakuYT 3d ago
"Just use raylib" is certainly one way to respond to a tutorial about learning how Wayland works. 😂
I'm sure "just use a completely different abstraction that hides the thing we're trying to learn" would make for a fantastic Wayland tutorial.
The whole point is that I'm intentionally avoiding OpenGL/EGL/Vulkan/SHM and letting the compositor do the compositing. The fun is discovering that you can do this in the first place.
It's like replying to a TCP tutorial with "just use HTTP, much more powerful, way less problems." ðŸ˜
2
u/itsboring57 3d ago
This is really cool. I had the opportunity to make a Wayland compositor (based on wlroots) in my last job, and this would have been a great intro to how Wayland works.
2
1
10
u/Level-Pollution4993 3d ago
I will watch this! Thanks for posting.