ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I would like to know how you can begin on graphics programming in Linux, Desktops. On the text cli only, this is simple by accessing the fb0 file. In Desktop vrrsions there is some other way. I need only help in starting a window and then any simple drawing algorithms for start.
What isnt clear to me after lots of research is how complex a simple window can be. I have Gnome, Kde, X11 distros. I know that GTK exists, but I imagine there is SDL as well.
Do I need X11 installed for a box?
Do I have a lot of dependency issues?
Do I need the GTK toolkit?
Scrutiny is warranted, but hey I am no typical pro.
-to open a window in X, you need X
-depends on what you use to open a window
-not really
GTK is a toolkit used to make windows and content in them (lots of other stuff got in over the years)
same with QT, EFL etc. (gnome is made on gtk, kde on qt)
SDL was originally for games
it's more or less a set of abstractions used to make a window, draw on/in it etc. (also sound, opengl)
it is very modular and fairly light
or you can just use X directly, as all others come to X in the end (well, theres wayland now)
X also has drawing routines
Try to use the desktop first, the framebuffer is not always available/accessible and many of these packages, while they "advertise" that they can work with it, ... they do not or it's the old "jump through a flaming hoop doing a spinning backflip" in order to get it working.
At least start with an XWindow environment, design your app, get to know how to do the UI programming.
And if it's a full screen, kiosk type of application; hence you not wanting all the window dressing and menu; remember that there are plenty of options such as running the XServer without a display manager, disabling the screen savers and power management. There are options to accomplish something like that, I do this all the time because framebuffers are difficult, hardware specific, and non-existent with some hardware types. Just my $0.02
This all seems reasonable. SDL is probably what I want. I just wanted to know if it can handle GUI. There are many graphic tiers in Linux distros, so I was wondering if SDL can handle the GUI across platforms?
Wouldnt want to get deep into a package dependency scenario. So the answer is something basic, but capable of Desktop interaction. I try to stay away from stuff like ncurses if possible. I can handle most of that on my own.
No game interests yet. Already have all the games I can possibly handle.
So I guess maybe I should check out SDL for now and go down that path. A simple 4 line example would be nice. GTK, X11 sounds a bit too big for me. After seeing how many files are in the usr directory, im kinda discouraged. BASH source code is like 4 megs big for example. Quite an experience.
Ok, thanks everyone. That sure made it easier. Decided Sdl was it. I have to do everything from scratch, but has all the desktop events I need. Wasnt too hard.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.