r/C_Programming • • Sep 06 '26

Wayland tutorial for beginners in pure C

https://www.youtube.com/watch?v=9OfcqNACohw
188 Upvotes

23 comments sorted by

10

u/Level-Pollution4993 Sep 06 '26

I will watch this! Thanks for posting.

4

u/WanderingInAVan Sep 06 '26

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.

2

u/elderfl0wer_ Sep 11 '26

The kinda videos I get recommended when I'm 2 weeks off of midsems 😭

2

u/goldenfrogs17 Sep 06 '26

what is wayland?

20

u/CodesOtakuYT Sep 06 '26

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

1

u/north9172 Sep 06 '26

Thank you

1

u/CodesOtakuYT Sep 07 '26

you're welcome :)

1

u/AxeForge Sep 06 '26

Cool to see another Clion user! Gives me incentive to try out wayland myself.

1

u/CodesOtakuYT Sep 07 '26

Yeaa CLion rocks!

1

u/_Arthxr Sep 07 '26

Nice. Any plans on the server side?

1

u/CodesOtakuYT Sep 07 '26

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 Sep 07 '26

Do aan X programming tutorial next, please.

1

u/CodesOtakuYT Sep 07 '26

I did a tutorial on it 3 years ago tho through XCB
https://www.youtube.com/watch?v=IPGROgWnI_8

1

u/stellar_x Sep 10 '26

Oh useful nice

-44

u/Run-OpenBSD Sep 06 '26

Just use raylib, much more powerful, way less problems

56

u/CodesOtakuYT Sep 06 '26

"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 Sep 07 '26

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

u/CodesOtakuYT Sep 07 '26

might do a tutorial on wlroots

1

u/TheTrendIsDead96 Sep 08 '26

bro just use paint if you want to show something on screen trust me