What should I use for creating graphics instead of accessing X11 directly?

0
0
Asked By MellowCedar42 On

I'm trying to understand how graphics programs are built beyond simply opening a window and drawing with raylib. I know raylib uses platform-specific systems such as X11 to create windows and drawing surfaces, but I've also heard that applications generally shouldn't access X11 directly. What layers or libraries are normally used instead? I'm especially interested in how window creation, input handling, drawing surfaces, and graphics APIs such as OpenGL or Vulkan fit together, and what alternatives are available besides raylib.

3 Answers

Answered By SilverKite5 On

The best tool depends on the kind of application you’re making. For a game or interactive graphics program, raylib, SDL, GLFW, OpenGL, or Vulkan are common options. For a traditional desktop GUI, frameworks such as GTK or Qt are more appropriate. Full game engines like Godot, Unity, and Unreal provide even more functionality, but also hide much more of the underlying system.

Answered By QuietMango18 On

X11 is an older, platform-specific windowing API. Using it directly ties your program to X11 systems and makes it harder to support Windows, macOS, or Linux systems using Wayland. A cross-platform library handles those operating-system differences for you. SDL and GLFW are relatively low-level choices, while raylib provides a simpler, more beginner-friendly layer on top.

Answered By OrbitingPine7 On

There are a few separate pieces involved. A windowing layer creates the window and provides a surface or framebuffer, while a graphics API such as OpenGL or Vulkan sends drawing commands to that surface. You also need input and event handling for things like the keyboard and mouse. These parts are often bundled together by libraries, which can make the whole process much easier to use.

MellowCedar42 -

So would a combination such as SDL for the window and input handling, plus Vulkan for rendering, cover those two main parts?

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.