IonicWind Software

Aurora Compiler => 2D Graphics => Topic started by: Zen on June 23, 2006, 03:52:31 AM

Title: 2D GUI Controls
Post by: Zen on June 23, 2006, 03:52:31 AM
Hello Everyone. I've not had much contact with the community for a while as I've harldy had time to breathe these past weeks.

Anyway i want to create some classes to create some GUI controls for 2D applications to ease the creation of 2D applications. So if people could bounce some ideas around about how would be a good way to go about doing this and perhaps a prefered structure of the classes that would be great and i can get cracking on it.

Lewis
Title: Re: 2D GUI Controls
Post by: J B Wood (Zumwalt) on June 23, 2006, 09:28:52 AM
A procedure for the buffer swapping.
Timer controls to keep the game moving at certain speeds.
Window handlers for multiple stacked windows in the gui, allowing for different buffers on the overlay swap.
Gamma controls to allow the light / darkness of the window to be controled.
*scratches head*
Title: Re: 2D GUI Controls
Post by: Protected on June 23, 2006, 01:40:56 PM
My suggestion is - do them independently, one control per class, and let the users handle the actual window creation themselves if they need.
Title: Re: 2D GUI Controls
Post by: Zen on June 26, 2006, 05:43:07 AM
Right i've been trying to design a good structure for all this to work and i think what im going to have to do is write a small engine class that all the controls and objects will be managed and controld by. To me it seems the easiest way to do it. The base "engine" class will sort of act like a mini API for all the controls and windows, and provide functions such as bringing one window infront of another when you click on it. So I hope to achieve a sort of clone of the way windows works within a 2D application. If im taking the long road around, someone let me know :D

Lewis
Title: Re: 2D GUI Controls
Post by: Parker on July 06, 2006, 01:11:09 PM
I suggest that you take Windows' approach where everything is a window (no wonder they called it windows ;) ). Everything receives its OnClick, OnHover, etc messages, and each type of window (button, edit, etc) handles them differently.

I would also have a main dispatch function, so that whenever the mouse moves, is clicked, keys are pressed, or any other events happen, any window that has focus will get that message.

I've attempted this a couple of times in IBasic, but not recently and I don't really know much about DirectX anyway. Good luck though.
Title: Re: 2D GUI Controls
Post by: Barney on July 06, 2006, 01:29:55 PM
Taking a look into one of the latest DirectX SDK's from Microsoft. There's quite usable DirectX GUI system in there and certainly worth checking.

Barney
Title: Re: 2D GUI Controls
Post by: Parker on July 06, 2006, 06:43:17 PM
DirectX 9 has a built in GUI system, but it runs incredibly slow on a builtin graphics chip, isn't non-microsoft compiler friendly, and wouldn't be linux compatible (though an OpenGL command set using the same classes and methods would be).
Title: Re: 2D GUI Controls
Post by: Zen on July 06, 2006, 06:49:52 PM
Yeah i am doing a lot of paper work for it at the moment. Im having some teathing problems finding the right way to manage the messages.

Ill crack it at some point. 2am now thought almost.

Lewis