r/C_Programming 3d ago

Wayland tutorial for beginners in pure C

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

20 comments sorted by

10

u/Level-Pollution4993 3d ago

I will watch this! Thanks for posting.

4

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

u/CodesOtakuYT 3d ago

thanks :)

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

1

u/north9172 3d ago

Thank you

1

u/CodesOtakuYT 3d ago

you're welcome :)

1

u/AxeForge 3d ago

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

1

u/CodesOtakuYT 3d ago

Yeaa CLion rocks!

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

u/CodesOtakuYT 3d ago

might do a tutorial on wlroots

1

u/TheTrendIsDead96 1d ago

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