Jump to content
  • Advertisement
Sign in to follow this  
Hakiko

Some more OpenGL problems

This topic is 4689 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

Hi, Still plowing through this OpenGL book, thanks for your help so far. I have run into a few more problems: When I compile it does not like #include <gl/glaux.h> says file not found it has no problem with #include <gl/gl.h> or #include <gl/glu.h> so I am a little confused by this also it gives me a function undeclared error when I use wglDeleteContext() it has no problem with wglMakeCurrent() shouldn't they be in the same place? are these all spelled correctly? would be my first question. I have found this book to be full of typos. Lots of NULL where there should be 0 things like that. My next thought would be that I need to link something else in the compiler. Book has been really sketchy on those details too, Thanks

Share this post


Link to post
Share on other sites
Advertisement
I noticed this and had to comment, I don't have an answer for your question, but you should be aware of this.

NULL is set up as such:

#define NULL 0

Which would actually mean null is zero... I have a feeling other "typos" can probably be explained in at least a few other cases.

I suspect you don't have the glaux.h file and so that's why it is saying file not found. Perhapse you should download the appropriate files. That will most likely fix it.

Share this post


Link to post
Share on other sites
Thanks to you both
Still confused about the NULL thing though as its never in the source code and if its something to be assumed for the book its never mentioned that I see.

Should I assume its a standard convention for all programs?

When you say download the appropriate files, could you suggest a safe place to get them? I am not too big on making random downloads.

Is wglDeleteContext() contained in gl/glaux.h?

Share this post


Link to post
Share on other sites
I apologize if the version I link to is out of date. It's the first thing I found, but you could give this a try: http://www.dyalog.com/download/glaux.zip

and I believe NULL is defined in the iostream header, though I could be mistaken about exactly where it is defined. If you get errors, just put this in:

#ifndef NULL
#define NULL 0
#endif

That will define it if it hasn't been defined already. It should be pretty standard though.

Share this post


Link to post
Share on other sites
glaux.h is deprecated. There may be places on the 'net that still have it available for download, but it's no longer in the opengl distributioni. If your book uses it, it's an out-of-date book.

This MSDN entry on wglDeleteContext says it's declared in wingdi.h, and needs opengl32.lib linked.

NULL is defined in stddef.h, which is included in many headers. I wouldn't expect you to have a problem with it, although I guess typos in a book can always mess you up ;)

Share this post


Link to post
Share on other sites
Thanks again
I did not have the iostream header included (I usually read the chapter, then type in the source code without comments, get it to compile, then go back and try to comment it myself and then change it around. For example there were several times where I was copying and pasing then changing a few values in the code, I will be trying to consolidate that into a more generic function. I find that this increases my comprehension greatly) Serves me right for blindly following the code in the book without thinking about it.

So are you saying that I should not need glaux.h at all, or has it been replaced with another header?

Sorry if I seem a little clueless on this stuff. I have done a lot of physics programming before (numerical integration, modeling of dynamic systems etc.) but it is usually classes and functions that I have developed from scratch so I don't really have any experience with other libraries.

Share this post


Link to post
Share on other sites
Quote:
Original post by Hakiko
So are you saying that I should not need glaux.h at all, or has it been replaced with another header?

From this MSDN entry: "The auxiliary library [glaux.h] is a collection of routines used by the sample programs listed in the OpenGL Programming Guide (called the "Red Book" by the people in the know; see the bibliography at the end of this article for more information). The auxiliary library is great for learning OpenGL, but I wouldn't recommend it for commercial applications. The auxiliary library was written to get something on the screen with as few lines of code as possible. The source code to the auxiliary library is included with the Microsoft Platform SDK...."

Me again. I also found references on the 'net saying glaux.h has many known memory leaks. It's not a necessary library for OpenGL development. It's a library of helper functions, such as image loading functions, that make it easy to get something going quickly, so that people learning OpenGL can learn (for example) how to use textures wouldn't have to learn how to load graphic files first. I don't know exactly when it was deprecated, but I started messing with OpenGL around early 2002, and it was deprecated then. There are other libraries that cover the same functionality, and it's not too difficult to roll your own functions that do what those in glaux.h do. I suggest working without it, but I checked, and like the above quote says, it is in the Microsoft Platform SDK, so if you want it, it's available.

Share this post


Link to post
Share on other sites
OK I linked
libopengl32.a
libgdi32.a
libuser32.a (to take care of an unknown error for CDS_FULLSCREEN)

and I am not getting any unknown function errors anymore
In fact I am not getting any errors at all, but a message pops up that says project did not compile.
I cannot find any messages in any of the tabs (using Dev-Cpp)indicating why it will not compile.

Thanks for pointing me to that MSDN site it helped me fix the CDS_FULLSCREEN problem on my own. Now I know where to go to find out what library stuffs in, very useful.



Share this post


Link to post
Share on other sites
OK it compiles now
Didn't change anything but my virus scan did an auto check right as it was trying to compile...not sure if that could have messed it up.
But it works
Really fast but it runs

Thanks alot

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!