LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Lightweight GUI/Library for X11 (ideally a C++ interface) (https://www.linuxquestions.org/questions/programming-9/lightweight-gui-library-for-x11-ideally-a-c-interface-639318/)

cpetzol2 05-02-2008 05:58 AM

Lightweight GUI/Library for X11 (ideally a C++ interface)
 
Hello,

I have been in search of a simple user interface layer to sit on top of X. I have already dabbled with GTK and QT, but they are way more complex than needed for my project.

I do not need to build a multifunctional application that is cross-platform with a trillion widgets. I need to make an interface that will always be fullscreen on a public computer.

I only need a few things out of the library; keyboard and mouse events, an OpenGL capable widget, some type of built in image support(loading and displaying), and video display. The video display is the one I have the most problems with.

I have looked at a couple of libs that do one thing or another, but never meet all my demands, and the ones that do are often way more than I want.

The solution may be to use multiple libs, but I would like to avoid that if possible. GLUT meets all my needs except the video requirements, and the same for GuiChan and SDL. Several game libraries have what I want but come with to much extra baggage.

Has anyone ran across or used such a library? Out of the many options, which one would you suggest?

Again, I am looking for the smallest, most straightforward solution available. (As few bells and whistles as possible)

Thanks

95se 05-02-2008 09:33 AM

Would Tk be good? I am pretty sure it covers everything you mentioned, including an OpenGL widget.

http://cpptk.sourceforge.net/
http://togl.sourceforge.net/

SciYro 05-02-2008 09:41 AM

What do you mean by video display?

SDL can output video, so can OpenGL (both proven by games running at faster FPS then videos run, and video players that use them to output).

Also, fltk has OpenGL and Image widgets.

cpetzol2 05-02-2008 11:43 AM

Thanks for the replies. I had never even realized Tk was an interface library. I always associated it with Tcl, thinking it was a language component/addon. Tk doesn't seem to have a c++ interface, or at least its not mentioned on the website, http://www.tkdocs.com/resources/languages.html .

Since my first post, I have really taken a liking to glfw (it doesn't even have widgets!)

What I meant by video display was creating a small frame where I need to display steaming avi, alongside some of my OpenGL (video) animations. This is not as straightforward as I thought.

I found one tutorial, http://nehe.gamedev.net/data/lessons....asp?lesson=35 , but it uses a Windows video library. This is totally new stuff for me, and I cant find much documentation. Im guessing I need a lib that can take a .avi frame, spit out a bitmap, and then feed that to OpenGL.

I was hoping to find an interface/library that would handle this for me as easily as possible. But for now, the search continues. The avi playback is still my biggest problem.

Thanks for the help.

paulsm4 05-02-2008 03:21 PM

Suggestion - maybe you're looking at this from the wrong angle.

Why not look at some Linux players that "kind-of" do what you want to do ... then look at the source, and see how they're written.

This article's fairly old, but it might be a good starting point:

http://www.linuxjournal.com/article/4698

PS:
From you're first post, I'd suggest either
a) SDL (as far as "simplicity" vs "power", I think that's your best bet)
... or ...
b) Program Xlib directly (DIY/minimalism to the max)

IMHO .. PSM

PS:
Are you by any chance a fan of the (legendary) "Programming Windows" Charlies Petzold?

cpetzol2 05-02-2008 06:34 PM

paulsm4 - Sorry, never heard of the guy (until now). My name just happens to be my old UIUC student ID.

As for the video playback, SDL seems to make it pretty easy, http://www.webkinesia.com/games/rawvideo.php . But I have also been trying to parse some source code, and it may not be extremely difficult to make my own little avi player that would work through OpenGL (instead of using SDL).

I never really even considered going as low-level as xlib (and I probably shouldnt, but that could be fun too). As soon as I started aiming for libs built on xlib, I opened a whole new can of worms that I completely overlooked. Now, I get to read about GLX, Xt, and glitz. I think that some of them may be a little more industrial than I need, but I am very new to OpenGL, and some of the reading on those libs has been very enlightening.

What to do. I am now pretty confident that their are several solutions for me, and I need to quit finding more options, and just pick one. Im not even close to a guru, so I wont be able fully make use of any library I choose anyway. There are just so many options, each with its pros and cons, and it's just a little intimidating/exciting.

I thank you guys for your posts, and you'll probably see me in many more threads with many more questions (hopefully I can narrow it down by then)


All times are GMT -5. The time now is 03:50 PM.