• Advertisement
Sign in to follow this  

Portable GUI

This topic is 3517 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need some help. I´m planning to make my own GUI library to run in my games. Maybe something with windows like World of Warcraft but not if it´s too complicated. Can you guys give me some advice? Note: I´m using C++ and I dont want to use Win32 GUI because it wont be easily ported to a MacOS or Linux

Share this post


Link to post
Share on other sites
Advertisement
Well... you can use Gtk or something for actual GUIs. For in-game guis you could use something like Crazy Eddie's GUI library (CEGUI).

Share this post


Link to post
Share on other sites
I´d rather make my own for now.

I don´t want to use libraries for now.

Share this post


Link to post
Share on other sites
It's pretty easy to build a gui library on top of SDL...
Hell, if I can do it, anybody can

Share this post


Link to post
Share on other sites
Google for "Immediate Mode GUI" and you should find some good resources to get started. In particular this (fourth result of the Google search for me at time of posting) may be a good starting point, although you should find no shortage of other material on the subject.


Is there any particular reason you don't want to use an existing well-written and tested library rather than writing your own?

Share this post


Link to post
Share on other sites
Quote:
Original post by jbadams
Google for "Immediate Mode GUI" and you should find some good resources to get started. In particular this (fourth result of the Google search for me at time of posting) may be a good starting point, although you should find no shortage of other material on the subject.


Is there any particular reason you don't want to use an existing well-written and tested library rather than writing your own?


Is there any particular reason you are linking to an immediate mode GUI tutorial over an object-oriented approach?

Share this post


Link to post
Share on other sites
Quote:
Original post by Dave
Is there any particular reason you are linking to an immediate mode GUI tutorial over an object-oriented approach?
Firstly, it's often a much simpler and more appropriate way to write a GUI (particularly if you're just after something simple) for games.

Second, there's no real reason you couldn't use the immediate mode techniques as the basis of a more object oriented approach once you've learned how it works and played with it a bit.


Feel free to link to a resource or resources on OO GUI design if you feel they'd be more appropriate, I'm sure our original poster could evaluate both approaches and choose whichever he feels is more appropriate for his uses, and I wouldn't mind seeing some good resources on the topic myself if you've got anything in mind.

Share this post


Link to post
Share on other sites
There are actually very few resources on how to write UIs. People tend to try and resolve all the problems themselves (which isn't a bad way to learn). I have found very little in my time writing UIs and everything i have learned has come from personal experience.

One quick thing before i bring the thread back on topic is that i am yet to see talk in articles about IM GUIs that cover certain states. Also, from what i have read, it basically seems like you're shifting UI state from the UI to the game. If that is what they are trying to achieve then great, but i don't see why.

:)

Share this post


Link to post
Share on other sites
Quote:
Original post by Dave
Also, from what i have read, it basically seems like you're shifting UI state from the UI to the game. If that is what they are trying to achieve then great, but i don't see why.
You're certainly removing UI state from the widgets themselves - there's no reason you couldn't create some sort of object to manage that state though, or have it handled by the scene containing said widgets, or whatever is appropriate for how your game is organised. I have never seen such a thing done in articles on IM GUI techniques, and it may well move the design away from being an IM GUI to do so, but it's still a perfectly valid way to solve the problems at hand.

Share this post


Link to post
Share on other sites
Quote:
Original post by jbadams
Quote:
Original post by Dave
Also, from what i have read, it basically seems like you're shifting UI state from the UI to the game. If that is what they are trying to achieve then great, but i don't see why.
You're certainly removing UI state from the widgets themselves - there's no reason you couldn't create some sort of object to manage that state though


See for me that means that when you write you application you actually have to do more work to get the UI running. It just seems nicer to me to say "I want a button there Mr.UI, keep drawing it there until otherwise".

Share this post


Link to post
Share on other sites
Thanks for the replies.

I just want to make my own GUI to make it simple to use rather than dealing with all the complicated parameters other APIs use.

I already got the GUI up and running (at least the buttons);
example:
BUTTON Button(Image,X,Y,bool Active);

rather than something Win32 or a similar library gives you.

And also what´s wrong with not using OO with C++.
It´s just another style of programming. I think people should use
whatever suits them best.

Share this post


Link to post
Share on other sites
I've been working on a GUI system similar to WoW's and it's coming along good, not ready for release or anything though. I used lua with luabind and I make frames and do everything the same way WoW does with their addons. It's not that hard really, it's just squares and every frame check if the mouse is over them or clicking on them and other things. It's your choice though if you want to use a pre-existing GUI(I'm sure there are lots) or make your own because making your own will take much longer but will be more customized for your liking.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement