View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# OpenGL GUI anyone? Updated on 11/17/05

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

207 replies to this topic

### #21WildFire-  Members

Posted 15 June 2005 - 08:22 AM

well on my athlon amd 1.8 running at 1.1 128 megs of ram and geforce fx 5200 i got 400-700 fps windowed, 400-500 max

### #22JavaCoolDude  Members

Posted 15 June 2005 - 08:31 AM

Quote:
 Original post by kusmaReally 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 ;)

Damn it, changing the fading time was supposed to be as simple as adding an (alphaFadeTime = "whatever here") in the setup file...turns out that it's broken.
No worries though, tonight you shall have it fully operational :)

### #23Taharez  Members

Posted 15 June 2005 - 08:52 AM

Looks like a nice project JavaCoolDude, I like the graphics :)

Quote:
 Original post by hercare there any other known opengl-gui's suitable for games out there?

Yep, CEGUI is a nice one that has renderers for DirectX, OpenGL, Ogre, and probably a bunch more by now. It's LGPL too.

### #24JavaCoolDude  Members

Posted 15 June 2005 - 08:57 AM

The Graphics are totally custom, you can specify your own by drawing your widgets into a texture and then providing the bounding rectangle in the XML file, check this out:
  <TexCoordsDesc xStart = "201" yStart = "2" xEnd = "233" yEnd = "34" type = "SLIDER"/>  <TexCoordsDesc xStart = "167" yStart = "2" xEnd = "199" yEnd = "34" type = "CHECK_BOX"/>  <TexCoordsDesc xStart = "131" yStart = "1" xEnd = "165" yEnd = "35" type = "CHECK_BOX_MARK"/>  <TexCoordsDesc xStart =   "1" yStart = "1" xEnd =  "65" yEnd = "66" type = "RADIO_BUTTON"/>  <TexCoordsDesc xStart =  "66" yStart = "2" xEnd = "130" yEnd = "66" type = "CHECK_RB_MARK"/>

### #25Drew_Benton  Members

Posted 15 June 2005 - 10:40 AM

CPU: Celeron 633mhz
Memory: 256MB SDRAM
GFX: Integrated Graphics (very old)

Windowed: 3 FPS, so it ran a bit slow, but it was still fully functionaly!
Fullscreen: Failed

Great work! It is very impresive on this very old computer I am working on right now.

Quote:
 What widgets am I missing in the above demo?

Just some ideas:

Scroll Box
RichEdit Box
Text Labels
Tabbed Displays
ListBox
And probabally a few others, but I'm too lazy to load up C# Windows.Forms to get more ideas [wink]

Great work! All of those great demos [grin]

### #26CyberJay  Members

Posted 15 June 2005 - 11:10 AM

~ 800fps windowed.
~200 fullscreen

AMD 3000+
1gb of RAM

Just an idea...

Maybe the ability to select the text in the text box.

The ability to put radio buttons into different groups so that each group of radio buttons could only have one selected at a time.

Maybe like a grid box or a grid of editable fields(forget what its called..lol).

Able to have different colored characters in a string for a label or button, ie a smiple text markup language ^1 would represent red or ^3 green, etc...

Maybe a Messagebox system (modal non-modal).

Hope that helps and I'll try and come up with more later.

### #27JavaCoolDude  Members

Posted 15 June 2005 - 12:56 PM

Thanks for your feedback guys, I appreciate it a lot.
Ok so I went ahead and implemented few more things like Vertical sliders, and tiled textured buttons.
Also I simplified the setup file by breaking it into several smaller files, look into the Data/GUI folder for more details [smile]
Check the main post for the updated binaries and pictures, ok back to implementing the rest of the suggested features.
Peace
PS: Kusma, I set the radio buttons to fade and come back three times as fast as anything else in the current frame, you can change the timing by modifying the alphaFadeScale in the XML files.

[Edited by - JavaCoolDude on June 15, 2005 7:56:36 PM]

### #28zix99  Members

Posted 15 June 2005 - 01:28 PM

Looks like a great GUI, can't wait to see it in some games. The one improvment that I found immediately is the fact that arrows keys don't work in the text boxes, and I use the arrow keys all the time. Just an idea.

Other than that, and the improvements already stated, looks really nice, can't wait to see the code :)

~Zix~

EDIT: And it runs at ~1000 FPS on my system, 2.6 ghz, Gefroce 6600

Posted 15 June 2005 - 02:07 PM

Really good job! :D

430 FPS with default windowed size
210 FPS with 1280*1024 windowed size

CPU: Intel P4 3GHz (Prescott 478)
RAM: 1GB PC3200
Card: ATI Radeon 9600 256MB DDR (Sapphire)

### #30phantom  Members

Posted 15 June 2005 - 03:16 PM

hmm as this is an on going thread which might be of intrest to some people i'm gonna sticky it for a while, as a decent GUI is something alot of people have been asking for [smile]

### #31JavaCoolDude  Members

Posted 15 June 2005 - 03:21 PM

W00t, thanks Phantom my man :D
Now I am trying to remove the GUI dependance from my own engine, I would like one of you fellas to provide me with a simple GLUT application with a mouse and keyboard listener as well as a main loop [smile]

[Edited by - JavaCoolDude on June 15, 2005 9:21:41 PM]

### #32Programmer16  Members

Posted 15 June 2005 - 03:31 PM

Very nice, hope to make one this good myself.

~270 FPS
CPU: 2.8GHz Celeron
GPU: 128MB ATI Radeon 9250 Xtasy Series
RAM: 1GB PC3200

### #33Drew_Benton  Members

Posted 15 June 2005 - 03:52 PM

Quote:
 Original post by JavaCoolDudeNow I would like one of you fellas to provide me with a simple GLUT application with a mouse and keyboard listener and a main loop; I'm trying to remove the GUI dependance from my own engine :)

#include "glut.h"void changeSize( int w, int h ){	// Prevent a divide by zero, when window is too short	// (you cant make a window of zero width).	if(h == 0)		h = 1;	float ratio = 1.0f * w / h;	// Reset the coordinate system before modifying	glMatrixMode(GL_PROJECTION);	glLoadIdentity();	// Set the viewport to be the entire window	glViewport(0, 0, w, h);	// Set the clipping volume	gluPerspective( 45, ratio, 1, 1000 );	glMatrixMode( GL_MODELVIEW );	glLoadIdentity();}void initScene() {	glEnable(GL_DEPTH_TEST);}void renderScene(void) {	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);	glutSwapBuffers();}void processNormalKeys(unsigned char key, int x, int y) {	if (key == 27) 		exit(0);}void inputKey(int key, int x, int y) {	switch (key) 	{		case GLUT_KEY_LEFT : 			break;		case GLUT_KEY_RIGHT : 			break;		case GLUT_KEY_UP : 			break;		case GLUT_KEY_DOWN : 			break;	}}void processMouse(int button, int state, int x, int y) {	int specialKey = glutGetModifiers();	// if both a mouse button, and the ALT key, are pressed  then	if ((state == GLUT_DOWN) && (specialKey == GLUT_ACTIVE_ALT)) 	{		// set the color to pure red for the left button		// if (button == GLUT_LEFT_BUTTON) 		// set the color to pure green for the middle button		//else if (button == GLUT_MIDDLE_BUTTON) 				// set the color to pure blue for the right button		// else	}}void processMouseActiveMotion(int x, int y) {	//if (specialKey == GLUT_ACTIVE_SHIFT) 	//else if (specialKey == GLUT_ACTIVE_CTRL)	//else if (specialKey == GLUT_ACTIVE_ALT)	//else}void processMousePassiveMotion(int x, int y) {	//if (specialKey == GLUT_ACTIVE_SHIFT) 	//else if (specialKey == GLUT_ACTIVE_CTRL)	//else if (specialKey == GLUT_ACTIVE_ALT)	//else}void processMouseEntry(int state) {	//if ( state == GLUT_LEFT )	//if( state == GLUT_ENTERED )}int main(int argc, char **argv){	glutInit(&argc, argv);	glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);	glutInitWindowPosition(100,100);	glutInitWindowSize(640,360);	glutCreateWindow("GLUT");	initScene();		// Keyboard	glutKeyboardFunc(processNormalKeys);	glutSpecialFunc(inputKey);	// Display and Idle	glutDisplayFunc(renderScene);	glutIdleFunc(renderScene);	glutReshapeFunc(changeSize);	// Mouse stuff	glutMouseFunc(processMouse);	glutMotionFunc(processMouseActiveMotion);	glutPassiveMotionFunc(processMousePassiveMotion);	glutEntryFunc(processMouseEntry);	glutMainLoop();	return(0);}

Ok here is something put together from a lot of the LightHouse3D Glut tutorials. If you take a look at the tutorials under the 'Input' category, it shows the mouse and keyboard stuff in more detail as to what you can use.

For more information on stuff that you can use, right click on a define'd expression and 'Go to declaration' to see more of it's kind. Good luck!

Posted 15 June 2005 - 06:19 PM

WOW! it ran steady at 1000fps.

athlon 3200 (32bit)
1gb pc3200
9800pro

btw dude ive seen your work, absolutely awesome!!! u seem to be a god of graphic programming. i hope to be as good as you someday...

### #35JavaCoolDude  Members

Posted 15 June 2005 - 07:01 PM

Quote:
 Original post by Drew_BentonOk here is something put together from a lot of the LightHouse3D Glut tutorials. If you take a look at the tutorials under the 'Input' category, it shows the mouse and keyboard stuff in more detail as to what you can use.For more information on stuff that you can use, right click on a define'd expression and 'Go to declaration' to see more of it's kind. Good luck!

Thanks dude, the code you posted helped me out a lot.

Ok ladies and gentlemen, announcing SXML GUI 0.5 for WIN users, grab it right here while it's still hot.
Here's a list of what you get:
Buttons, TextBoxes, vertical and horizontal sliders, Radio Buttons, CheckBoxes, Panels, Separators, Labels.
A MediaPathManager.
Some other cool stuff.

I haven't used Linux that much therefore I have no clue on how to go about implementing a robust timer in the said environment. If anyone out there can look at the code and modify Tools/FPSCounter and Tools/Benchmark to whatever Linux uses you'll be my hero...well for a day or two :D

### #36Drew_Benton  Members

Posted 15 June 2005 - 07:13 PM

Oh wow, that's great! I just tried it in the GLUT example and I must say, quite impressive! When I get my dev computer up and running in a week or so, I will definitly start messing with this library [wink] Thanks for all the hard work!

### #37subi  Members

Posted 16 June 2005 - 01:46 AM

yeah nice work mate, the demo run's just fine ...haven't had a chance yet to play around with it but will do in the next few days

### #38kusma  Members

Posted 16 June 2005 - 01:58 AM

okay, i think you kinda misunderstood me ;)
the fade i was talking about wasn't the hover-fade, but rather the selection-change-fade. another note is that in the 0.5-release, moving the cursor in textboxes with the arrow-keys seems to be broken. as a user, i would also like to be able to select a chunk of text with both shift+arrow-keys and the mouse-cursor if possible. other than that, this seems like a really nice gui-library, by the way :)

### #39evolutional  Moderators

Posted 16 June 2005 - 02:02 AM

Going to give this a try, I'll need some form of GUI for my 4E4 entry ;)

### #40OpenGL_Guru  Members

Posted 16 June 2005 - 02:46 AM

how would you make this GUI in pure openGL/glut style mode..kinda like what JavaDude was asking about? i mean yeah you have your textures and your font etc etc but i guess how do you make them react to each other.. i guess by checking mouse over or something, i concur that someone would get some major props for writing a tut on this :)

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.