Archived

This topic is now archived and is closed to further replies.

incubator01

buttons, list boxes,....

Recommended Posts

incubator01    122
I am having huge trouble finding a tutorials or documents about drawing controls (buttons, listboxes etc) with SDL for use in games. SDL_gui seems to be offline or something but I cant find the docs for it and it is masked unstable in gentoo, so, well, any alternatives? or how do professional opengl games create + draw their controls and handle their events? [edited by - incubator01 on May 25, 2004 10:11:53 AM]

Share this post


Link to post
Share on other sites
ACAC    122
Writing a simple GUI system isnt too difficult, you base it all around a CWindow, which has lots of functions then derive all other buttons, controls etc from CWindow. Each window can send messages to a particular list and then you can process them (where each control has an ID) ...

Or you could forget what i said and... BOUNCE!

Share this post


Link to post
Share on other sites
incubator01    122
CWindow and DX are windows.
I am an open source programmer for linux. (windows comes second place)
I have no intentions to fiddle with XLib wich isnt advised anywhay.
and Qt is too heavy for full fledged games.

Share this post


Link to post
Share on other sites
sagwagon    122
Heh, I think he meant to implement your own CWindow class that draws a rectangle on the screen and can display text and images, then use that to implement CButton, CLabel, CWidgetwhatever.

Share this post


Link to post
Share on other sites
fooman    122
i thought your a programmer... make a cWindowclass, with some basic things like posX,posY,Width,Height, a virtual renderroutine, and an inputhandling with virtual functions for it (onClick, onMouseOver,...). then use polymorphism, to create your cButton, cListBox, etc.

Doesn''t look to hard for me.

Share this post


Link to post
Share on other sites
Chozo    176
It''s like drawing anything else. If you can draw a square, you can draw a button. If you can draw a circle and some text, you can draw a radio button, and so on.

The part you should be concerned about is behavior. That''s where most of your time will be spent and will probably make you figure it''s not worth it when you could hunt down a library to do it. Don''t forget that most professional game houses have more than one person working on things, and those that don''t often use simplified GUIs (eg, a Doom style menu system).

Share this post


Link to post
Share on other sites
incubator01    122
Yes, i understand, but in my search for such a library I ame across SDL_gui, but that seems abandoned and there is no documentation of it

If you know of any library for cross-platform simple controls, please, it would be of great help

Share this post


Link to post
Share on other sites