March 28, 2024, 05:43:18 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


2D GUI Controls

Started by Zen, June 23, 2006, 03:52:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zen

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

J B Wood (Zumwalt)

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*

Protected

My suggestion is - do them independently, one control per class, and let the users handle the actual window creation themselves if they need.

Zen

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

Parker

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.

Barney

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

Parker

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).

Zen

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