GUI Design

Published May 24, 2008
Advertisement
Been a very long while since I made a post but I felt today was a good day to provide some update on the 'framework' which I'm more appropriately calling an engine based on GLFW.

I've been focusing on the GUI design lately and I believe it's ideal. To use the GUI you simply create a new class that derives from the abstract class called Window. You overload a couple virtual functions like Render, Update, etc how you want. After that you simply pass this off to the WindowManager which handles the rest. Pretty simple and easy to use.

Here's an example of how I could create a new type of Window.

class BasicWindow : public Odorless::Engine::UI::Windows::Window			{			public:				BasicWindow() : Odorless::Engine::UI::Windows::Window()				{					//...				}				BasicWindow(const float &x, const float &y, const float &width, const float &height) : Odorless::Engine::UI::Windows::Window(x, y, width, height)				{					//...				}				~BasicWindow()				{					//...				}				int Initialize()				{					return 0;				}				void Dispose()				{					//...				}				void Update(const float &dt)				{					//...				}				void Render(const float &dt)				{					glBegin(GL_QUADS);					glVertex3f(this->_2fPosition[0], this->_2fPosition[1], 0);					glVertex3f(this->_2fPosition[0], this->_2fPosition[1] + this->_2fDimensions[1], 0);					glVertex3f(this->_2fPosition[0] + this->_2fDimensions[0], this->_2fPosition[1] + this->_2fDimensions[1], 0);					glVertex3f(this->_2fPosition[0] + this->_2fDimensions[0], this->_2fPosition[1], 0);					glEnd();				}			};


Obviously in that example BasicWindow doesn't have much functionality but that's simply for the sake of keeping this post short.

Once I get some sexy looking GUI going I'll let you guys know ;).
Previous Entry I'm in
Next Entry Yay BSPs!
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement

Latest Entries

Boo!

1613 views

Group blog

1092 views

Easy Usage

1109 views

Angel Script

970 views

My game idea

986 views

Lightmaps

960 views

Yay BSPs!

960 views
Advertisement