Jump to content

  • Log In with Google      Sign In   
  • Create Account

Which Of These 3 API Combinations Would You Advise (GUI's)?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 Toothpix   Crossbones+   -  Reputation: 810

Like
0Likes
Like

Posted 30 July 2013 - 04:46 PM

I am writing a game editor in C, and these are my 3 choices I see right now, along with my reasoning. Which of these would you advise, and why?

 

1. OpenGL + X (I'm already using OpenGL for the rendering, I already know a small bit of X programming)

2. OpenGL + SDL (SDL is more abstracted and cross platform than X, but I have never used it)

3. GTK+ (It is written in C like my program, but uses more resources and I have never used it)

 

I was kind of leaning towards option 1 because my logic is that in the time it takes to learn a whole new API, I could have written a small GUI system in OpenGL and X that fulfills all of my specific needs (correct me if I am wrong) and is lighter weight.

 

My Questions:

1. Which way would you do it?

2. Why would you do it that way?

3. How long do you think it would take YOU to do it your way?

4. How long do you think it would take YOU to do it the first way?

 

I very much appreciate your answers, if you have any.


C dominates the world of linear procedural computing, which won't advance. The future lies in MASSIVE parallelism.


Sponsor:

#2 Servant of the Lord   Crossbones+   -  Reputation: 19564

Like
1Likes
Like

Posted 30 July 2013 - 07:09 PM

I can't comment on X or GTK+, but I can comment on SDL. SDL is a lightweight wrapper around basic keyboard/mouse/gamepad input and graphical windows. Unless things changed with SDL 2.0, SDL doesn't have any GUI system. You can ofcourse use it in addition to a GUI system, but it doesn't come with GUI features out-of-the-box.


Edited by Servant of the Lord, 30 July 2013 - 07:10 PM.

It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#3 Bregma   Crossbones+   -  Reputation: 5133

Like
3Likes
Like

Posted 30 July 2013 - 07:36 PM

1. OpenGL + X (I'm already using OpenGL for the rendering, I already know a small bit of X programming)

2. OpenGL + SDL (SDL is more abstracted and cross platform than X, but I have never used it)

3. GTK+ (It is written in C like my program, but uses more resources and I have never used it)

1. OGL + X11 = too much nope...  detecting all the extensions, handling all the corner cases, doing backflips and handstands to use 1980s tech to do a 1990s job, no thanks.  Just choosing the right visual and obtaining the correct GLX context is painful, let alone event processing.  There's a reason why all those toolkits evolved to wrap X11 and make it entirely disappear from the API.  Very large learning curve, poor documentation, difficult to debug.

 

2. OGL + SDL = good choice.  Small learning curve, good documentation.  Sometimes a pain to debug.

 

3. GTK+ = run, don't walk away -- a massive, massive, heavyweight API in which you have to rewrite the C++ runtime in every source file, and with no upstream support (maintenance is not considered a community activity, reinventing the entire API every couple of years is where it's at). 

Very large learning curve, poor documentation, difficult to debug.

 

And yes, I've used all of the above.


Stephen M. Webb
Professional Free Software Developer

#4 SiCrane   Moderators   -  Reputation: 9598

Like
1Likes
Like

Posted 30 July 2013 - 08:18 PM

Another option you might want to look at is Tk, which has C bindings and does have a more or less complete set of GUI widgets.



#5 Dunge   Members   -  Reputation: 405

Like
0Likes
Like

Posted 30 July 2013 - 08:31 PM

I would take a look at Qt



#6 Servant of the Lord   Crossbones+   -  Reputation: 19564

Like
0Likes
Like

Posted 30 July 2013 - 08:42 PM

I would take a look at Qt

 

Qt is C++, not C. I started to suggest that myself, actually - I like Qt. smile.png


It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#7 Toothpix   Crossbones+   -  Reputation: 810

Like
0Likes
Like

Posted 31 July 2013 - 11:48 AM

I think I will follow Bregma's advice and just use OGL + SDL. That way I can make a version for Windows, Mac, and Linux without learning the intricacies of Win32, Cocoa, and Xlib. Thank you to all of you for your advice.


C dominates the world of linear procedural computing, which won't advance. The future lies in MASSIVE parallelism.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS