Graphics Programming, New
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 i haven't dealt with X much, this looks good http://math.msu.su/~vvb/2course/Bori...ow/xintro.html the fastest and lightest way to get things on screen under linux (other then using the framebuffer) is by using X shm protocol extensions http://www.x.org/releases/current/do...proto/shm.html |
Quote:
Don't do direct X Window programming these days. Also wayland is going to replace X Windows. Use a tookit like GTK, QT, EFL, SDL, They allow arbitrary drawing canvas. You can use direct OpenGL (Mesa3D, freeglut) too. |
What kind of graphics programming ?
You want a GUI ? QT, GTK, and many others. You want to program games or just draw stuff on a screen ? Use SDL2. |
all of the above
but QT5 might be winning out on the GTK VS. QT squabble there is also just x11 and c++ for that have a look at Gmic and the "Cimg.h" library yes it is a header and a library http://cimg.sourceforge.net/download.shtml it is tiny and can do many REALLY COOL things http://cimg.sourceforge.net/screenshots.shtml like Tetras in 197 lines of code http://sourceforge.net/p/cimg/source...les/tetris.cpp |
All the packages listed thus far I agree with.
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. |
Quote:
Hey, this is good stuff. Thanks for the lead. |
Quote:
|
You don't say what language you want to write in. Most have several toolkit libraries. Here are a few:
|
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.
|
All times are GMT -5. The time now is 11:31 PM. |