Jump to content

  • Log In with Google      Sign In   
  • Create Account


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.

  • You cannot reply to this topic
207 replies to this topic

#81 JavaCoolDude   Members   -  Reputation: 670

Like
0Likes
Like

Posted 06 July 2005 - 02:26 PM

Sorry for the lack of updates, lately I've been very busy (pulling 12-14 hours long shifts :-/).
Abraham Lopez got in touch with my via email and it seems that he's got a new port to Linux up and running, I'll be posting a link to it later tonight (if I ever go back to my place :-/).
Peace

Sponsor:

#82 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

0Likes

Posted 11 July 2005 - 11:03 AM

Nice work! Keep up the good work, and keep posting updates to this!

#83 JavaCoolDude   Members   -  Reputation: 670

Like
0Likes
Like

Posted 12 July 2005 - 01:56 PM

Thank you all for your precious feedback [smile]
I updated the main post with new stuff, go fetch it [wink]

#84 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

0Likes

Posted 12 July 2005 - 11:35 PM

Hey, glad to see the great work, might actually use it for my current project thanks to your awesome decision to use the Zlib license (which I definitely recommend to the rest of the developers on this website).

My question is, why did you write your own XML parser? There are great, license compatible libraries out there that are already complete and ready to use. I grabbed a copy of your code and I'm currently in the process of porting it to TinyXML, a great, small, Zlib licensed core XML parser. It has an impressively small footprint, and is very fast.

If you'd like my port to TinyXML, I can commit it back, just ask. I'm trying to register to the site currently, but something in their ASP broke (don't ask me, I gave up web developing a bit ago). If you'd like to contact me, you can reach me at awalton@gmail.com.

Thanks again for the good work!

Andrew

#85 evolutional   Moderators   -  Reputation: 1045

Like
0Likes
Like

Posted 12 July 2005 - 11:51 PM

Quote:
Original post by Anonymous Poster
My question is, why did you write your own XML parser? There are great, license compatible libraries out there that are already complete and ready to use. I grabbed a copy of your code and I'm currently in the process of porting it to TinyXML, a great, small, Zlib licensed core XML parser. It has an impressively small footprint, and is very fast.


Hey, I'd LOVE to see this ported to TinyXml. I use TinyXml in my game so having to compile another XML parser in with it doesn't seem to appealing to me :-/ I've also modified TinyXML to read from PHYSICS_FS instead of the normal file access means, this allows me to load my XML from Zip files and all that jazz.

This project has certainly come on a long way since I last checked it out. I'd recommend that you guys get a SF.net project sorted out to allow others to join and contribute.

I'm going to download this tonight and try to see how well it integrates within my game (4E4 entry). I'm at a stage now where a GUI will be useful, if only for health bars and menu screens (but I do have other plans [wink]). The TinyXML based version is something I'd love to see in the future.

EDIT: I've just taken a cursory glance and fear that too many of the supporting systems will conflict with my architecture [sad]. Things such as having a global Logger, for example and having textures stored differently will unfortunately mean I can't use it straight from the box. Things such as keyboard input, mouse input and textures are all handled very specifically to this project; it'd be useful for people like me to be able to hook up some form of 'coupling' class to an abstract interface used by your GUI... My texture classes may not be like yours, but using a proxy class and an interface I'd probably be able to make them behave like them, for example.

With a bit of work, this will go a long way :)

Keep it up!

[Edited by - evolutional on July 13, 2005 6:51:26 AM]

#86 ciroknight   Members   -  Reputation: 328

Like
0Likes
Like

Posted 13 July 2005 - 02:14 AM

Well, it does suck this won't work for you, but where my project was a baby when I ran into this, it's absolutely great for me!

Porting to TinyXML is going to take a lot of work, but it's going quickly. I'm going to add a global object to use as a go between the GUI toolkit and TinyXML so that it doesn't take very much code modification. You'll get what I mean when you see the code.

Also, there are other little things I disagree with in the code, but I'm going to bring them up here first before I go changing the whole world around just to fit my needs better. Why, for example, did you bother to write your own string class? Speed? The STL has an alright string class, and I tend to use it for most of my work (better than const char * splattered throughout the code, and having to constantly check sizes, use memcpy, etc, etc). I'm a big fan of doing things the proper OO way, verses the C++ way, so I guess it's a personal preference deal, but I digress.

I think it would also be possible to open up the log interface so that you can plug in your own global log interface if you like (for example, my game uses a flatfile to log instead of XML simply because a log reader doesn't need the metadata XML provides).

I'm very happy I ran into this project. :)

[edit uno] Question to JavaCoolDude:
What extensions in OpenGL required you to need GLee? I'm pretty new to OpenGL (having been a DirectX guy in my prior tiddling with graphics, though I'd never really cared for them before), and I'm unfamiliar with all of the function families, but I can't percieve linking such a fat library for just a few function calls. I also want to mention straight forward how much I really don't like the fact that all of OpenGL is still functional programming and how objects seem to be an afterthought; this was definitely something that DirectX got right, even if it was at the cost of performance initially. *shakes fist*

TinyXML port is going along nicely, though a lot of code refactoring has happened, and I'm not sure if you'll like it. We'll probably have to sort things out if we do ever decide to merge the two.

[Edited by - ciroknight on July 13, 2005 3:14:16 PM]

#87 JavaCoolDude   Members   -  Reputation: 670

Like
0Likes
Like

Posted 13 July 2005 - 01:59 PM

Greetings fellow developers, glad to see some enthusiasm and brain storming going in here[smile]

My question is, why did you write your own XML parser? There are great, license compatible libraries out there that are already complete and ready to use. I grabbed a copy of your code and I'm currently in the process of porting it to TinyXML, a great, small, Zlib licensed core XML parser. It has an impressively small footprint, and is very fast.

My decision to write my own and "crappy" XML loader came from the fact that up until you guys have mentioned TinyXML, I've never ran across a samll XML parsing library that would not add 2 or 3 more megs to my rendering engine.
Porting my stuff (shall I say our stuff now [wink]) to TinyXML now that we're approaching the 1.0 release milestone seems like a wonderful suggestion, I'm all for it.

@evolutional:
Sup man, I think the problems lies in the lack of use of namespaces, something that could be easily fixed. I propose GLGUI:: or GUIUtils::, but again the group vote is more suitable for coming up with things like that.

@ciroknight:

I wrote my own String class because I wanted to perform things like adding a string and a scalar with a simple operator rather than resorting to another global function that would do that for me.
Plus, I'm the self-proclaimed champion of "reinvent the wheel, do it now" :D
GLee is there because I needed few extra GL tokens and functions for my texture class that have yet to make it to an official GL.h release.

I'm looking forward to see what your port over to tiny xml will look like, keep us all updated.
Peace.


#88 Sagar_Indurkhya   Members   -  Reputation: 253

Like
0Likes
Like

Posted 14 July 2005 - 03:36 AM

Hey JavaCoolDude. Really great stuff. We are already planning on using it for our university project.

If I have any spare time, I am going to see if I can make a nice gui editor for this wonderful program. I think that with a gui editor, it will become a really big thing.

#89 Sagar_Indurkhya   Members   -  Reputation: 253

Like
0Likes
Like

Posted 14 July 2005 - 03:46 AM

Quote:
Original post by ciroknight
Also, there are other little things I disagree with in the code, but I'm going to bring them up here first before I go changing the whole world around just to fit my needs better. Why, for example, did you bother to write your own string class? Speed? The STL has an alright string class, and I tend to use it for most of my work (better than const char * splattered throughout the code, and having to constantly check sizes, use memcpy, etc, etc). I'm a big fan of doing things the proper OO way, verses the C++ way, so I guess it's a personal preference deal, but I digress.


JavaCoolDude, I think this is very important. Your project has the potential to become a big hit, but I think you need to try and use as many standardized things as possible. Using STL and TinyXML is a good start. If you use STL, then if other programmers want to help, they will be able to get comfortable really quickly.

Also I was wondering if .NET is an ok language to write the GUI editor in? I thought that once we get the .NET C++ one working, we can make the GUI editor using your GUI library itself.


#90 evolutional   Moderators   -  Reputation: 1045

Like
0Likes
Like

Posted 14 July 2005 - 03:52 AM

Quote:
Original post by JavaCoolDude
@evolutional:
Sup man, I think the problems lies in the lack of use of namespaces, something that could be easily fixed. I propose GLGUI:: or GUIUtils::, but again the group vote is more suitable for coming up with things like that.


Nah, I don't think that will do it... The issue is that I have my own Texture classes and Managers, just as I have my own Keyboard/Mouse managers and system. To use the GUI as it stands I'd have to have TWO texture managers (one for the GUI, one for the game) and TWO input managers which work in a similar, yet different way.

However, if you customised your GUI to accept an interface class for things such as textures, texturemanagement, events, etc there is a good chance that I could hook up an adapter or bridge class to allow my system to work with yours (bridge might actually be more appropriate). I could hook up a special TextureManagerAdaptor class based off GUI::ITextureManager for my manager to interact with your GUI system.

Anyway, it's just an idea - I'll definitely take another look at this if I ever start afresh with another project though.

Keep up the good work!

[Edited by - evolutional on July 14, 2005 10:52:55 AM]

#91 Sagar_Indurkhya   Members   -  Reputation: 253

Like
0Likes
Like

Posted 14 July 2005 - 01:31 PM

Just realized, this is just like that new MS Windows Longhorn technology, Avalon thingy, where all your forms are created in XML. If you research the technology right, you might just be able to hack around with there gui editor, and have it spew out your XML format.

#92 ciroknight   Members   -  Reputation: 328

Like
0Likes
Like

Posted 14 July 2005 - 11:38 PM

I'm currently working on porting the whole project to using standard strings (which was the part I was really worried about) and TinyXML. It's also requiring me to juggle around the object model a little [instead of having all of the objects inheirit from a base class allowing for XML object access, all of the objects will have to request the data they want from a standard class]. Speed-wise I don't know if this will be a concern, and it is a step away from OO, but I think it'll help, and I'll probably code it both ways and see which works better for me.

I'm also developing on Linux, so it's kinda important to me that the GUI editor not be in .Net. I know Mono allows for running .Net code on Linux, but I've consistantly refused to use Mono simply because there are only a few programs that will depend on it, and it's a huge install set. I'd personally prefer Java, or even C++ to it, simply because of their portability, and Java's built in XML handling is exceptional.

Lastly, my version's gonna change a lot of things; I'd had to almost rewrite almost every XML object so that it better supports my coding model, which may or may not be a good thing. Instead of things like "<BGColor r="1" g="3" b="5">", I rearranged it to being "<Color type="bgcolor" r="1" g="3" b="5">", making use of tuples already included. I think it's easier to parse, and it allows for easier exclusions of incorrect versions ("type="panel-color" is not registered, skipping tag"). I really wish I didn't have to make all of these choices myself, but it's probably better that way because there'd probably be lots of flame wars about it.

Can we give it a name and wrap a namespace around everything? That way we can go ahead and start a SourceForge project and drum up some support. Just an idea.

Port's about 1/3 of the way done due to conflicting schedules (I'm a college student too) and finals rapidly approaching. I would say with time off for the new Harry Potter book on Saturday, and with finals on Thursday next week, it'll be pressing to get it done, but I'll do my best. I'm maintaining two versions (one is a rewrite of the entire XML subsystem, the other's just a quick replacement of the XML accessors with TinyXML accessors). The latter will be done first, of course, but I hope to have both available at about the same time.

w00t. Andrew.

#93 ciroknight   Members   -  Reputation: 328

Like
0Likes
Like

Posted 14 July 2005 - 11:48 PM

Quote:
Original post by evolutional
However, if you customised your GUI to accept an interface class for things such as textures, texturemanagement, events, etc there is a good chance that I could hook up an adapter or bridge class to allow my system to work with yours (bridge might actually be more appropriate). I could hook up a special TextureManagerAdaptor class based off GUI::ITextureManager for my manager to interact with your GUI system.


This is more of what I am doing with TinyXML. The problem is, it'll fairly quickly get to the point the entire code is abstracted away, and you're left with an interface mashup, and no real code (which is why I'm maintaining two versions; one with it being a remodel, one being an adaptor). It's a good thing in object orientation, but it's not nessicarily the best in C++ (virtual functions are a bitch).

I really think we need more discussion on how we'd rewrap the object to be an interface (simply because Application Interfaces are the most important aspect to version compatibility). Of course, we could also just go balls to the wall and do it now, simply because we're pre-1.0 and not enough people are using it to need to maintain version compatibility.

#94 Sagar_Indurkhya   Members   -  Reputation: 253

Like
0Likes
Like

Posted 15 July 2005 - 03:11 AM

Quote:
Original post by ciroknight
I'm currently working on porting the whole project to using standard strings (which was the part I was really worried about) and TinyXML. It's also requiring me to juggle around the object model a little [instead of having all of the objects inheirit from a base class allowing for XML object access, all of the objects will have to request the data they want from a standard class]. Speed-wise I don't know if this will be a concern, and it is a step away from OO, but I think it'll help, and I'll probably code it both ways and see which works better for me.

I'm also developing on Linux, so it's kinda important to me that the GUI editor not be in .Net. I know Mono allows for running .Net code on Linux, but I've consistantly refused to use Mono simply because there are only a few programs that will depend on it, and it's a huge install set. I'd personally prefer Java, or even C++ to it, simply because of their portability, and Java's built in XML handling is exceptional.

Lastly, my version's gonna change a lot of things; I'd had to almost rewrite almost every XML object so that it better supports my coding model, which may or may not be a good thing. Instead of things like "<BGColor r="1" g="3" b="5">", I rearranged it to being "<Color type="bgcolor" r="1" g="3" b="5">", making use of tuples already included. I think it's easier to parse, and it allows for easier exclusions of incorrect versions ("type="panel-color" is not registered, skipping tag"). I really wish I didn't have to make all of these choices myself, but it's probably better that way because there'd probably be lots of flame wars about it.

Can we give it a name and wrap a namespace around everything? That way we can go ahead and start a SourceForge project and drum up some support. Just an idea.

Port's about 1/3 of the way done due to conflicting schedules (I'm a college student too) and finals rapidly approaching. I would say with time off for the new Harry Potter book on Saturday, and with finals on Thursday next week, it'll be pressing to get it done, but I'll do my best. I'm maintaining two versions (one is a rewrite of the entire XML subsystem, the other's just a quick replacement of the XML accessors with TinyXML accessors). The latter will be done first, of course, but I hope to have both available at about the same time.

w00t. Andrew.


Ok. How about something like... wxWidgets or something?

The first version of the GUI won't be very useful. Probably just a tree structure you can view, and edit there properties. It sure beats typing out XML though.

Oh, something else I thought would be cool. We could have the GUI editor run like VB, where you can hit the play button, and you can see how your GUI would really look.

Hopefully, once the GUI editor, etc is good enough, we can make the GUI editor using the OpenGL GUI itself.


#95 ciroknight   Members   -  Reputation: 328

Like
0Likes
Like

Posted 15 July 2005 - 03:36 AM

wxWidgets is a great choice, as I would have suggested it. I have mild experience with it, as GraphThing (a program I'm currently modifying for my own use) uses it.

As for your idea to hit a button and see the GUI, that's actually quite what would happen; an abstract application can (and in a lot of ways, already is) built to allow for any number of GUI widgets to be made and rendered. Simply modify your XML file, and pass it to the application as a parameter ( ./SXMLGUITest path/sampleconf.xml ) and it'll load the GUI against a blank background. You can implement this by having the button action in the Application run the above system call.

As a matter of fact, once my port to TinyXML is up and running, it'll be possible to make an application to where after a change is made to the XML file, the program will reload it and start drawing the widgets immediately; on-the-fly GUI editing.

I really would like a consensus vote though before I go ahead and code both directions; I really like refactoring the code so that XML is entirely abstracted away inside of the code, but the current object model works, and is plenty fast (I think; I have nothing to base this against).

One last note; I just realized how dumb I've been this morning; the GUI has been running slow as crap for me (6 frames a second, WHAT?!) and it was because I was using MESA as a software renderer instead of passing everything through DRI on my system. Someone with similar specs to my system posted earlier how he was experiencing the same deal, and I assure you that this is why (if you are running Linux as I am).

Hope to see your GUI editor up and running soon!

(P.S. In Linux, this could end up being a whole 'nother window manager, with native OGL support and XML configurations, like Windows Avalon or (without the XML) Mac OS X's Aqua. I know Sagar was excited about this earlier too, but I'm just now starting to jump on board with that feeling. It still needs a few widgets (text boxes, a canvas, etc), but definitely do-able. We'll see once we get some more code generated.

One last request; evolutional: you said you wanted to abstract away the interface for texture manager and events, is there any way you can start work on that now? I'm going to try to get ahold of JavaCoolDude today and set up a sourceforge project so that we can have CVS access and such, hopefully to get everyone who's interested some code to work with. )

#96 JavaCoolDude   Members   -  Reputation: 670

Like
0Likes
Like

Posted 15 July 2005 - 06:14 AM

Oh boy, plenty of things to read and even more awesome suggestions.
First off all we really need to come up with a decent name and namespace for the project before we go ahead and request some sourceforge space. In one of my private message sessions somebody already suggested OpenGUI. I personally think that suggestion is not bad at all but I would like to hear more from the community before we reach a final decision. SXML GUI is a temporary name, just in case some of you are still wondering about the meaning of S, it simply stands for shaders since in the version tied to my rendering engine, I have this widget called GUIMaterialSurface that supports multi-texturing and shaders as well.

@ciroknight:
I do like your proposal to modify the XML tags a bit, actually I believe it is more flexible and more compelling than my original approach. I would also suggest that the base class should not be too strict regarding case sensitivity.
I wouldn't worry too much about speed hits as long as things are sent around by reference.
I also dig the idea of having the GUI update on the fly as we change the XML configuration file, we really need to start compiling a list of the features that we wish for so we can check em off as we implement them.

Now about the editor:
I'm all for using Java to put together a beta version and then maybe later on port it to using this GUI package.
Speaking of Java, I already wrote the font exporter using that language and curiously enough I never bothered to putting it up for grabs.
Here's a link to it, make sure you save your fonts as TGA and not PNG since the compression algorithm of the latter tends to create severe artifacts around the font's char.
I would certainly wait for the TinyXML port to be up and ready before I start writing the editor, unless someone else volunteers for the said task.

Peace


#97 ciroknight   Members   -  Reputation: 328

Like
0Likes
Like

Posted 15 July 2005 - 10:55 AM

A way to deal away with case sensitivity is to either use toUpper or toLower on the string (both are in the <algorithm> header; used by transform ( string.begin(), string.end(), dest.begin(), (int(*)(int))tolower); ) but of course this requires the use of an STL string container ;).

JavaCoolDude, you've made this such a hard port... Lol, I hate to rag on you, but it's just so tedious because your XML accessors are embedded with your XML reader classes, so removing the XML parser pretty much requires me to touch every object.

The design path I've ratified (as of the end of today) is to add a class called XMLArbiter which hides TinyXML from the rest of the code by reading in all of the XML into container classes. To get the data, you'll need to use a set of functions that allow you to move back and forth within the internal iterators, return Tuples, etc, etc. This does require quite a monolithic class, but it's a very fast fix.

The way to abstract this monolith a bit would be to make it plugable: instead of IOXMLObject being inheirited and each object being in charge of knowing how to load the XML, we make XMLArbiter a very low level object and build an inheiritance tree above it (GuiPanelXMLArb, or something), but this gets very complicated ass you add widget types, and even though this class will be heavy, it'll be much cheaper than all of the virtual functions you'd have instead.

Another feature we need to add before the 1.0 Milestone is to enable GUI elements to toggle between hidden and visible. I think you've already started work on this with the Tabbed panels code, but I showed my friend the code today and his first comment was "Can you close the panels?". His next question was "Can you move the panels out of your way?" ;). Good comments came as well with the newest build ("It looks like Enlightenment 17, it's smooth. I love how it blends").

JavaCoolDude: I'm going to send you an email with a (suggested) API for the new object, and show you what I want to change exactly before I go through with it, and you end up hating it (hehe). I'm going to also send you a new format we can ratify the XML configuration on, hopefully; it's important for parsing reasons.

Work is steadily progressing. Hope to have the code to the community soon!

Btw, OpenGUI doesn't quite give us the bite; we need to indicated that it's a 3D environment or something. Windows has Avalon.. we could pun that; (Avalon means "Apple Island", which is just BEGGING to be made fun of; come on.. if you don't see that as funny you don't have a sense of humor, geek or non-geek). Avalon is also the site of the burial grounds of King Arthur.. Um, other names.. Babylon 3D Gui? CoolDudeGUI? Um.. geeze I'm not really good with names.

#98 Sagar_Indurkhya   Members   -  Reputation: 253

Like
0Likes
Like

Posted 15 July 2005 - 12:42 PM

ciroknight - I want to wait until you finish porting to release the GUI stuff. It is pretty simple right now. One thing I wanted to ask you is that is there any way wxWidgets would allow me to run OpenGL inside? Here is what I am talking about:

File/Tree Structure ------ Small space where GUI Editor continuously updates new GUI for display ----- Properties window

I want to stay as far from the code for good practice to make sure the XML format is strong enough. Some of my old projects had bad hacks to get around XML crap I couldn't do. The GUI editor should directly spew out XML, which the GL_GUI should read in perfectly.

JavaCoolDude, I was wondering if you were going to get a sourceforge page? It would be very convenient to upload projects there. Also, do you have an official name for this project?

#99 Sagar_Indurkhya   Members   -  Reputation: 253

Like
0Likes
Like

Posted 15 July 2005 - 12:51 PM

I think we should have a short, concise GUI name, or perhaps an acronym. The name is the thing that will draw the most attention.

One thing I thought of would be to name it GUI. Just GUI. It would be short, unconsciously leads towards standardization, and confuse people.

The C++ Standards Committee said that one day perhaps C++ will have a standard GUI. Oh, they are including an XML parser in the next version.

#100 ciroknight   Members   -  Reputation: 328

Like
0Likes
Like

Posted 15 July 2005 - 02:11 PM

WxWidgets does have an object to work with OpenGL, it's called WxGLCanvas; the API is very much like Windows MFCs. I'm not sure if it has the ability to run GLUT, though, since WxWidgets has its own message manager (as do most toolkits).

Um, as for a name, not a clue. GUI is too empty of a name and would be rejected by SourceForge, and I agree that it is very important to get a homepage and a public CVS server as soon as possible so we can start getting other people to come in.

As for the C++ standards committee, they're just slaves to the machine. They'll probably actually take code from either Xerces (another free XML parser) or TinyXML and include it as standard (of course, this will take some work; XML Namespaces are a huge issue, as are the million different parsing techniques you can use). I doubt if I'm alive the day that C++ gets a standard GUI, because even if they did code an entire free, crossplatform GUI toolkit (a hell of a lot of code), nobody would support it. Windows is quite too deeply embedded with Win32 (they're having a lot of resistance to Avalon and XAML as well), Linux/BSDs are too tied to X11 to give it up (even though it's a disaster), and Mac OS X has Aqua and the Cocoa API.

I think for now we should thank our good graces the C++ standards committee encorporated the STL; I'd be lost without it. I remember the good ol' days when I hand coded open ended containers in C; endless debug cycles, headaches, cursing, even destroyed a monitor. All of the old C functions with the letter "M" proceeding them should be stricken from the public view when working with C++ (no more evil Malloc and Memcpy debugging).

I apologize.. I should get back to work ;)




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.



PARTNERS