• Advertisement
Sign in to follow this  

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

This topic is 4228 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
First page content Updated.

Thanks for the help guys, I included the zlib license in version 0.7 of my GUI which is now available in the first page, check it out. [smile]

Share this post


Link to post
Share on other sites
Hi,

I tryed to port your code to Linux, as you sugest, just creating a makefile, but the compiler don't like some lines of your code. The errors I found until now are:

g++ -O3 -c TextureUtils.cpp
TextureUtils.cpp: In member function `bool Texture::createNormalizingCube(const
char*, unsigned int, bool)':
TextureUtils.cpp:799: error: syntax error before `char'
TextureUtils.cpp:800: error: syntax error before `char'
TextureUtils.cpp:801: error: syntax error before `char'
TextureUtils.cpp:821: error: syntax error before `char'
TextureUtils.cpp:822: error: syntax error before `char'
TextureUtils.cpp:823: error: syntax error before `char'
TextureUtils.cpp:843: error: syntax error before `char'
TextureUtils.cpp:844: error: syntax error before `char'
TextureUtils.cpp:845: error: syntax error before `char'
TextureUtils.cpp:866: error: syntax error before `char'
TextureUtils.cpp:867: error: syntax error before `char'
TextureUtils.cpp:868: error: syntax error before `char'
TextureUtils.cpp:889: error: syntax error before `char'
TextureUtils.cpp:890: error: syntax error before `char'
TextureUtils.cpp:891: error: syntax error before `char'
TextureUtils.cpp:912: error: syntax error before `char'
TextureUtils.cpp:913: error: syntax error before `char'
TextureUtils.cpp:914: error: syntax error before `char'
make: *** [TextureUtils.o] Error 1

AND

g++ -O3 -c GUIUtils.cpp
GUIUtils.cpp: In member function `virtual void
GUITextBox::checkKeyboardEvents(KeyEvent, int)':
GUIUtils.cpp:2187: warning: converting to non-pointer type `char' from NULL
GUIUtils.cpp:2188: warning: converting to non-pointer type `char' from NULL
GUIUtils.cpp: In member function `virtual const Tuple4i&
GUITextBox::getWindowBounds()':
GUIUtils.cpp:2316: warning: converting to non-pointer type `char' from NULL
GUIUtils.cpp: In member function `virtual void
GUIComboBox::actionPerformed(GUIEvent&)':
GUIUtils.cpp:3299: error: no matching function for call to `GUIEventListener::
actionPerformed(GUIEvent)'
../Events/GUIEventListener.h:10: error: candidates are: virtual void
GUIEventListener::actionPerformed(GUIEvent&)
GUIUtils.cpp: In member function `const char* GUIComboBox::getSelectedItem()
const':
GUIUtils.cpp:3444: error: passing `const String' as `this' argument of `
String::operator const char*()' discards qualifiers
GUIUtils.cpp: In member function `const char* GUIComboBox::getItem(unsigned
int) const':
GUIUtils.cpp:3449: error: passing `const String' as `this' argument of `
String::operator const char*()' discards qualifiers
GUIUtils.cpp:3489:2: warning: no newline at end of file
make: *** [GUIUtils.o] Error 1

I could try to "fix" it if I have more time to study your code. But maybe you could just look at the error messages and quickly find what are the problems.

Best Regards,

ALopes.

Share this post


Link to post
Share on other sites
A quick and dirty port to Linux using scons build system. Just type
scons in the directory and scons in the example directory. It should
work.

Just some syntaxical fixes, i don't have any Windows, so i can't check if it works with this OS

Download here !


[Edited by - Evadream on July 7, 2005 2:08:35 AM]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Nice work! Keep up the good work, and keep posting updates to this!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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. )

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 ;)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
  • Advertisement
  • Popular Tags

  • Advertisement
  • Popular Now

  • Similar Content

    • By reenigne
      For those that don't know me. I am the individual who's two videos are listed here under setup for https://wiki.libsdl.org/Tutorials
      I also run grhmedia.com where I host the projects and code for the tutorials I have online.
      Recently, I received a notice from youtube they will be implementing their new policy in protecting video content as of which I won't be monetized till I meat there required number of viewers and views each month.

      Frankly, I'm pretty sick of youtube. I put up a video and someone else learns from it and puts up another video and because of the way youtube does their placement they end up with more views.
      Even guys that clearly post false information such as one individual who said GLEW 2.0 was broken because he didn't know how to compile it. He in short didn't know how to modify the script he used because he didn't understand make files and how the requirements of the compiler and library changes needed some different flags.

      At the end of the month when they implement this I will take down the content and host on my own server purely and it will be a paid system and or patreon. 

      I get my videos may be a bit dry, I generally figure people are there to learn how to do something and I rather not waste their time. 
      I used to also help people for free even those coming from the other videos. That won't be the case any more. I used to just take anyone emails and work with them my email is posted on the site.

      I don't expect to get the required number of subscribers in that time or increased views. Even if I did well it wouldn't take care of each reoccurring month.
      I figure this is simpler and I don't plan on putting some sort of exorbitant fee for a monthly subscription or the like.
      I was thinking on the lines of a few dollars 1,2, and 3 and the larger subscription gets you assistance with the content in the tutorials if needed that month.
      Maybe another fee if it is related but not directly in the content. 
      The fees would serve to cut down on the number of people who ask for help and maybe encourage some of the people to actually pay attention to what is said rather than do their own thing. That actually turns out to be 90% of the issues. I spent 6 hours helping one individual last week I must have asked him 20 times did you do exactly like I said in the video even pointed directly to the section. When he finally sent me a copy of the what he entered I knew then and there he had not. I circled it and I pointed out that wasn't what I said to do in the video. I didn't tell him what was wrong and how I knew that way he would go back and actually follow what it said to do. He then reported it worked. Yea, no kidding following directions works. But hey isn't alone and well its part of the learning process.

      So the point of this isn't to be a gripe session. I'm just looking for a bit of feed back. Do you think the fees are unreasonable?
      Should I keep the youtube channel and do just the fees with patreon or do you think locking the content to my site and require a subscription is an idea.

      I'm just looking at the fact it is unrealistic to think youtube/google will actually get stuff right or that youtube viewers will actually bother to start looking for more accurate videos. 
    • By Balma Alparisi
      i got error 1282 in my code.
      sf::ContextSettings settings; settings.majorVersion = 4; settings.minorVersion = 5; settings.attributeFlags = settings.Core; sf::Window window; window.create(sf::VideoMode(1600, 900), "Texture Unit Rectangle", sf::Style::Close, settings); window.setActive(true); window.setVerticalSyncEnabled(true); glewInit(); GLuint shaderProgram = createShaderProgram("FX/Rectangle.vss", "FX/Rectangle.fss"); float vertex[] = { -0.5f,0.5f,0.0f, 0.0f,0.0f, -0.5f,-0.5f,0.0f, 0.0f,1.0f, 0.5f,0.5f,0.0f, 1.0f,0.0f, 0.5,-0.5f,0.0f, 1.0f,1.0f, }; GLuint indices[] = { 0,1,2, 1,2,3, }; GLuint vao; glGenVertexArrays(1, &vao); glBindVertexArray(vao); GLuint vbo; glGenBuffers(1, &vbo); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, sizeof(vertex), vertex, GL_STATIC_DRAW); GLuint ebo; glGenBuffers(1, &ebo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo); glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices,GL_STATIC_DRAW); glVertexAttribPointer(0, 3, GL_FLOAT, false, sizeof(float) * 5, (void*)0); glEnableVertexAttribArray(0); glVertexAttribPointer(1, 2, GL_FLOAT, false, sizeof(float) * 5, (void*)(sizeof(float) * 3)); glEnableVertexAttribArray(1); GLuint texture[2]; glGenTextures(2, texture); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, texture[0]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); sf::Image* imageOne = new sf::Image; bool isImageOneLoaded = imageOne->loadFromFile("Texture/container.jpg"); if (isImageOneLoaded) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, imageOne->getSize().x, imageOne->getSize().y, 0, GL_RGBA, GL_UNSIGNED_BYTE, imageOne->getPixelsPtr()); glGenerateMipmap(GL_TEXTURE_2D); } delete imageOne; glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, texture[1]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); sf::Image* imageTwo = new sf::Image; bool isImageTwoLoaded = imageTwo->loadFromFile("Texture/awesomeface.png"); if (isImageTwoLoaded) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, imageTwo->getSize().x, imageTwo->getSize().y, 0, GL_RGBA, GL_UNSIGNED_BYTE, imageTwo->getPixelsPtr()); glGenerateMipmap(GL_TEXTURE_2D); } delete imageTwo; glUniform1i(glGetUniformLocation(shaderProgram, "inTextureOne"), 0); glUniform1i(glGetUniformLocation(shaderProgram, "inTextureTwo"), 1); GLenum error = glGetError(); std::cout << error << std::endl; sf::Event event; bool isRunning = true; while (isRunning) { while (window.pollEvent(event)) { if (event.type == event.Closed) { isRunning = false; } } glClear(GL_COLOR_BUFFER_BIT); if (isImageOneLoaded && isImageTwoLoaded) { glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, texture[0]); glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, texture[1]); glUseProgram(shaderProgram); } glBindVertexArray(vao); glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, nullptr); glBindVertexArray(0); window.display(); } glDeleteVertexArrays(1, &vao); glDeleteBuffers(1, &vbo); glDeleteBuffers(1, &ebo); glDeleteProgram(shaderProgram); glDeleteTextures(2,texture); return 0; } and this is the vertex shader
      #version 450 core layout(location=0) in vec3 inPos; layout(location=1) in vec2 inTexCoord; out vec2 TexCoord; void main() { gl_Position=vec4(inPos,1.0); TexCoord=inTexCoord; } and the fragment shader
      #version 450 core in vec2 TexCoord; uniform sampler2D inTextureOne; uniform sampler2D inTextureTwo; out vec4 FragmentColor; void main() { FragmentColor=mix(texture(inTextureOne,TexCoord),texture(inTextureTwo,TexCoord),0.2); } I was expecting awesomeface.png on top of container.jpg

    • By khawk
      We've just released all of the source code for the NeHe OpenGL lessons on our Github page at https://github.com/gamedev-net/nehe-opengl. code - 43 total platforms, configurations, and languages are included.
      Now operated by GameDev.net, NeHe is located at http://nehe.gamedev.net where it has been a valuable resource for developers wanting to learn OpenGL and graphics programming.

      View full story
    • By TheChubu
      The Khronos™ Group, an open consortium of leading hardware and software companies, announces from the SIGGRAPH 2017 Conference the immediate public availability of the OpenGL® 4.6 specification. OpenGL 4.6 integrates the functionality of numerous ARB and EXT extensions created by Khronos members AMD, Intel, and NVIDIA into core, including the capability to ingest SPIR-V™ shaders.
      SPIR-V is a Khronos-defined standard intermediate language for parallel compute and graphics, which enables content creators to simplify their shader authoring and management pipelines while providing significant source shading language flexibility. OpenGL 4.6 adds support for ingesting SPIR-V shaders to the core specification, guaranteeing that SPIR-V shaders will be widely supported by OpenGL implementations.
      OpenGL 4.6 adds the functionality of these ARB extensions to OpenGL’s core specification:
      GL_ARB_gl_spirv and GL_ARB_spirv_extensions to standardize SPIR-V support for OpenGL GL_ARB_indirect_parameters and GL_ARB_shader_draw_parameters for reducing the CPU overhead associated with rendering batches of geometry GL_ARB_pipeline_statistics_query and GL_ARB_transform_feedback_overflow_querystandardize OpenGL support for features available in Direct3D GL_ARB_texture_filter_anisotropic (based on GL_EXT_texture_filter_anisotropic) brings previously IP encumbered functionality into OpenGL to improve the visual quality of textured scenes GL_ARB_polygon_offset_clamp (based on GL_EXT_polygon_offset_clamp) suppresses a common visual artifact known as a “light leak” associated with rendering shadows GL_ARB_shader_atomic_counter_ops and GL_ARB_shader_group_vote add shader intrinsics supported by all desktop vendors to improve functionality and performance GL_KHR_no_error reduces driver overhead by allowing the application to indicate that it expects error-free operation so errors need not be generated In addition to the above features being added to OpenGL 4.6, the following are being released as extensions:
      GL_KHR_parallel_shader_compile allows applications to launch multiple shader compile threads to improve shader compile throughput WGL_ARB_create_context_no_error and GXL_ARB_create_context_no_error allow no error contexts to be created with WGL or GLX that support the GL_KHR_no_error extension “I’m proud to announce OpenGL 4.6 as the most feature-rich version of OpenGL yet. We've brought together the most popular, widely-supported extensions into a new core specification to give OpenGL developers and end users an improved baseline feature set. This includes resolving previous intellectual property roadblocks to bringing anisotropic texture filtering and polygon offset clamping into the core specification to enable widespread implementation and usage,” said Piers Daniell, chair of the OpenGL Working Group at Khronos. “The OpenGL working group will continue to respond to market needs and work with GPU vendors to ensure OpenGL remains a viable and evolving graphics API for all its customers and users across many vital industries.“
      The OpenGL 4.6 specification can be found at https://khronos.org/registry/OpenGL/index_gl.php. The GLSL to SPIR-V compiler glslang has been updated with GLSL 4.60 support, and can be found at https://github.com/KhronosGroup/glslang.
      Sophisticated graphics applications will also benefit from a set of newly released extensions for both OpenGL and OpenGL ES to enable interoperability with Vulkan and Direct3D. These extensions are named:
      GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_memory_object_win32 GL_EXT_semaphore GL_EXT_semaphore_fd GL_EXT_semaphore_win32 GL_EXT_win32_keyed_mutex They can be found at: https://khronos.org/registry/OpenGL/index_gl.php
      Industry Support for OpenGL 4.6
      “With OpenGL 4.6 our customers have an improved set of core features available on our full range of OpenGL 4.x capable GPUs. These features provide improved rendering quality, performance and functionality. As the graphics industry’s most popular API, we fully support OpenGL and will continue to work closely with the Khronos Group on the development of new OpenGL specifications and extensions for our customers. NVIDIA has released beta OpenGL 4.6 drivers today at https://developer.nvidia.com/opengl-driver so developers can use these new features right away,” said Bob Pette, vice president, Professional Graphics at NVIDIA.
      "OpenGL 4.6 will be the first OpenGL release where conformant open source implementations based on the Mesa project will be deliverable in a reasonable timeframe after release. The open sourcing of the OpenGL conformance test suite and ongoing work between Khronos and X.org will also allow for non-vendor led open source implementations to achieve conformance in the near future," said David Airlie, senior principal engineer at Red Hat, and developer on Mesa/X.org projects.

      View full story
    • By _OskaR
      Hi,
      I have an OpenGL application but without possibility to wite own shaders.
      I need to perform small VS modification - is possible to do it in an alternative way? Do we have apps or driver modifictions which will catch the shader sent to GPU and override it?
  • Advertisement