   Load PNG
  Which is the easiest way to work with PNG textures (I want them for transparency) in OpenGL? I work in Visual Studio using C.   
  Try LodePNG. It is extremely easy to use, although not as fast as LibPNG. If you want to support many image formats at once, try DevIL.-- Alex   ;  Thanks!Exactly how do I use it with OpenGL, can it create a texture or just give me the raw data? (I dont have much experience with texture loading in OpenGL, just used the code from the Nehe tutorial)   ;  Not to forget SOIL.It is pretty easy to use as it will directly give you an OpenGL texture ID. So does DevIL, but i prefer SOIL.   ;  There's little need for libraries to create OpenGL textures for you, because it's very simple to create an OpenGL texture from the raw image data. First, you load the image using one of the libraries mentioned.Now, if that worked, you can create the OpenGL texture to store the image.int texture_id;glGenTextures(1, &texture_id); // create 1 texture and store its ID in the variable texture_idNext you write tell OpenGL that the texture must use the pixel data that you have loaded. Assuming that the image is RGBA format, that the variable named "pixels" is a pointer to the raw pixel data, and that "width" and "height" contain the width and height of the image, do this:glBindTexture(GL_TEXTURE_2D, texture_id);glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_CHAR, pixels);Once this is done, you no longer need the raw image data, so you can delete itdelete pixels;;  I tried to use LodePNG but it doesnt work, my triangles are white (i.e. no texture). I use the following codeunsigned error;unsigned char* image;size_t w, h, x, y;  /*load the PNG in one function call*/error = LodePNG_decode32f(&image, &w, &h, "rwar.png");glGenTextures(1, &texture[0]);glBindTexture(GL_TEXTURE_2D, texture[0]);glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, image);It seems to load the file properly, I get no error and the size is correct. I looked through some of the data and it looks correct too. It's nothing wrong with my other code, it works if I load a bmp-image usingAUX_RGBImageRec *TextureImage[1];TextureImage[0]=LoadBMP("Data/NeHe.bmp");glBindTexture(GL_TEXTURE_2D, texture[0]);glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);so it has to be something when I create the texture from the raw data[Edited by - zurekx on August 10, 2008 7:12:46 AM];http://www.opengl.org/wiki/index.php/Common_Mistakes#Creating_a_TextureQuote:The texture won't work because it is incomplete. The default GL_TEXTURE_MIN_FILTER state is GL_LINEAR_MIPMAP_NEAREST so GL will consider the texture incomplete as long as you don't create the mipmaps.;  Thanks. That wasn't the problem, however, but the texture width/height were no powers of 2, but appearantly gluBuild2DMipmaps doesn't require that   