Jump to content
  • Advertisement
Sign in to follow this  
kelcharge

Alternative to GLaux?

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

I've been reading the NeHe tuts and I can't seem to get to the glaux replacement code. Any help would be much appreciated...

Share this post


Link to post
Share on other sites
Advertisement
Does this fix mem leaks from the glaux lib? No problems with it or whatever?

I can't get it to work, I am using the NeHe tutorial for lesson 6, maybe you could show an example?

[Edited by - kelcharge on August 13, 2005 2:03:51 PM]

Share this post


Link to post
Share on other sites
Perhaps i better write a tutorial about it sometime, you have no idea how many that ask what your asking.

1. it does not fix the memory leaks in glAux.lib, it actualy never uses it so memory leaks are not an issue here, i hope.

2. if you have the exact lesson 6 code it should not be a problem, if you follow all the posts i made about this in the thread in my sig you should be able to get it running.
This one if your unshure.

3. if it still doesn't work then tell me exactly what goes wrong and what the compiler spits out, along with any other information that is relevant (like what brand/version is your compiler).

Share this post


Link to post
Share on other sites
You could try using SDL. That is what I use. www.libsdl.org. It is great and available on many platforms.

If that helps, I am not sure...

Share this post


Link to post
Share on other sites
Here's some code I wrote sometime ago using corona it's really basic and really haven't tested it yet but it should work in most of the cases. You should be able to adapt/fix it to your needs without much trouble


GLuint LoadTexture(const char* path)
{
GLuint texture;
corona::Image* image = corona::OpenImage(path);
int cmp;
int fmt;
corona::PixelFormat format = image->getFormat();

switch( format )
{
case corona::PF_B8G8R8:
case corona::PF_R8G8B8:
fmt = (format == corona::PF_B8G8R8) ? GL_BGR : GL_RGB;
cmp = 3;
break;
case corona::PF_B8G8R8A8:
case corona::PF_R8G8B8A8:
fmt = (format == corona::PF_B8G8R8A8) ? GL_BGRA : GL_RGBA;
cmp = 4;
break;
}

glGenTextures(1,&texture);
glBindTexture(GL_TEXTURE_2D,texture);
gluBuild2DMipmaps(GL_TEXTURE_2D,cmp,image->getWidth(),image->getHeight(),fmt,GL_UNSIGNED_BYTE,image->getPixels());

delete image;

return texture;
}

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!