OpenGL GUI anyone? Updated on 11/17/05

Started by
206 comments, last by Alpha_ProgDes 17 years, 9 months ago
hey what about some threedimensional panels?
Advertisement
The GUI looks nice , but how about the usability of GUI. How to create components , how to use them ? Some simple example maybe.
3200 fps
6800 GT OC (BFG)
Athlon 64 3500+
A8N SLI D
My specs:
P4 1.6Ghz
Radeon 9200
512 RAM

Default size, 310 FPS
Maximized(1024x728), 218 FPS

I like it. What language did you use. If C++, I'd definetly be interested in some source code, especially for the text boxes.


Yup C++ all the way :)
Ok here's my to-do list, please notify me if I'm missing anything:
TextArea
SelectionBox
Vertical Sliders
Drop down menues

The skinnable surface is already there and here's a list of its features:

Vertex and Pixel Shader/Program support.
Alpha/Blending attribues.
Up to 8 textures.
Materials.

I will provide an example later with some fancy pixel shading :D

Now this GUI should be really easy to use, to handle the user events, one is ought to provide the GUIFrame with an actionPeformed function to where it will direct all the events, an example:

void SceneFrame::actionPerformed(GUIEvent evt){  if(!evt.getEventSource())    return;  const String &callbackString = evt.getCallbackString();  if(evt.getEventSource()->getWidgetType() == CHECK_BOX)  {    GUICheckBox   *checkBox = (GUICheckBox*)evt.getEventSource();    if(callbackString == "showVelocities")    {      if(velocitiesSurface) velocitiesSurface->setVisible(checkBox->isChecked());      return;    }    if(callbackString == "showLocations")    {      if(locationsSurface) locationsSurface->setVisible(checkBox->isChecked());      return;    }    if(callbackString == "showNormals")    {      if(normalsSurface) normalsSurface->setVisible(checkBox->isChecked());      return;    }    if(callbackString == "displayInfo")      if(checkBox->isClicked() && demoInfo)        demoInfo->setVisible(checkBox->isChecked());  }  if(evt.getEventSource()->getWidgetType() == RADIO_BUTTON)  {    GUIRadioButton   *radioButton = (GUIRadioButton*)evt.getEventSource();  }  if(evt.getEventSource()->getWidgetType() == SLIDER)  {    GUISlider   *slider = (GUISlider*)evt.getEventSource();    if(callbackString == "swimSize")    {      swimmerSize = clamp(int(slider->getProgress() * 10.0f), 1, 8);      slider->setLabelString(String("Swimmer Size: ") + swimmerSize);      return;    }    if(callbackString == "swimRadius")    {      swimmerRadius  = clamp(slider->getProgress(), 0.1f, 1.0f);      swimmerRadius *= 10.0f;      slider->setLabelString(String("Swimmer Radius: ") + int(swimmerRadius));      swimmerRadius *= 8.0f;      return;    }    if(callbackString == "swimSpeed")    {      swimmerSpeed  = clamp(slider->getProgress(), 0.1f, 1.0f);      slider->setLabelString(String("Swimmer Speed: ") + int(swimmerSpeed*10));      swimmerSpeed = 1.0f - swimmerSpeed;      swimmerSpeed = 0.0125f + swimmerSpeed*0.0125f;      return;    }    if(callbackString == "swimHeight")    {      swimmerHeight  = clamp(slider->getProgress(), 0.1f, 1.0f);      slider->setLabelString(String("Swimmer Height: ") + swimmerHeight);      return;    }    if(callbackString == "dampFactor")    {      dampFactor  = slider->getProgress();      dampFactor  = dampFactor/10.0f + 0.85f;      slider->setLabelString(String("Damp Factor: ") + dampFactor);      return;    }  }}


Aight, off to work on the new stuff
Looking nice.

Quote:Original post by JavaCoolDude
would you guys like to see my GUI widgets in a crossplatform library instantly functional with any existent C++ OpenGL code out there?


Of course. Might I suggest releasing it under the MIT license? Here's a link to the lua page describing the license (as well as the license itself). However, if you want something more restrictive (the GPL is an alternative, but be aware of the viral implications of releasing code under the GPL), do whatever you want.

Quote:What kinda frame rate are you guys getting?

Sorry, I don't currently have access to windows.
Yes, i would be interested in it. But something i really would like is if you would consider writing an article on how to make a complete GUI system. There are really no tutorials/articles on it on the net. Not any thak i can find anyhow.

Keep up the good work.
-------------------------------------------------Founder and DirectorAllSoft Studios
amd64 3500+
1gig ram
radeon x800xl

getting :o 2200fps windowed, 650fps maximised
Really nice looking gui. Great work. I'm getting between 40 and 60 fps on my gf4go 420.

One notice though, IMO the fades for the check- and radiobuttons are too slow. Perhaps I've just had too many cups of coffee today, tho ;)
Quote:Original post by Allmight
Yes, i would be interested in it. But something i really would like is if you would consider writing an article on how to make a complete GUI system. There are really no tutorials/articles on it on the net. Not any thak i can find anyhow.


The book Data Structures for Game Programmers by Ron Penton has a useful GUI class for use with SDL (though the concepts would work outside of SDL). I have mixed feelings about the rest of the book, as most of the book teaches you how to do things that you should be using the c++ standard library for.

This topic is closed to new replies.

Advertisement