tags:

views:

108

answers:

4

I want to make a GUI for a game coded in C for Linux Platform.Are there any API`s to do this or what woulb be the easiest way to make a gui.

A: 

What kind of game? There's several toolkits for normal GUI programming on X-windows. Check out gtk, Qt, wxWidget. If it's an action game meant to run outside of X or something, check out SDL.

harald
its a simple pc game
Abhi
@Abhi Define "simple" -- is this going to be simple in a sense like chess is simple, and could be emulated with normal UI widgets such as buttons, etc. A simple platform game would require more effort, and having to draw your game environment yourself.
Rowland Shaw
+3  A: 

SDL is best if you want to have a lot of action, with smooth animation, like this or this game . It is also very useful if your game is going to have 3D graphics. Here is a list of SDL games. SDL gets its excellent 3D capabilities through OpenGL. SDL also has decent sound capabilities.

GTK and QT work best for games where smooth animated movement all the time is not a requirement. Games like this. GTK & QT also works very well for games with simple animations like this. A huge list of GTK games.

However, to complicate things a bit, both GTK and QT have their own OpenGL extensions, which means you can develop fast-paced action games with those toolkits too.

There is also DirectFB which does not even need X11, just a framebuffer, but still has hardware acceleration.

Update: based on ninjaljs suggestion that the OP might want a toolkit for widgets inside a game, here is a widget library for use within SDL.

Amigable Clark Kant
I think the OP wants a GUI library for games, i.e. something to use for in-game menus.
ninjalj
+2  A: 

Do you want a full fledged GUI toolkit or just a graphics API to create simple GUI elements yourself?

Sebastian N.
This should be a comment, not an answer.
Daniel Standage
I don't have enough reputation to comment on questions by other people :(
Sebastian N.
A: 

A quick apt-cache search gives me libguichan and libparagui.

ninjalj