   image loading
  Good morningI want to know how to load an image and convert it to binary image using opengl. If there is any lesson explains that kindley put the link here.Thanks in advance for any help 
  http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=06 ;Thanks Tom Friedl. I saw this lesson before , it doesn''t help . what I want is to load an image file into a matrix , say, image[xsize][ysize][zsize] so I can change the resolution, intensity, colors, ... of the image ..Any idea how to do that ?;  well i am not sure if this is what your asking but i spose you could put the values of the r,g,b into a struct like so:struct{unsigned int imagesizex;int imagesizey;unsigned int r;unsigned int g;unsgined int b;} image;and then edit them, loading this r,g,b data every time you change the values.  ;quote:Original post by Nolimit  Thanks Tom Friedl. I saw this lesson before , it doesn''t help . what I want is to load an image file into a matrix , say, image[xsize][ysize][zsize] so I can change the resolution, intensity, colors, ... of the image ..Any idea how to do that ? You DONT want a 3D array, thats just wrong, be cause you are saying that for every X pixel you have ysize pixels and for every ysize pixel you have zsize pixels, which is just wrongInstead, what you want to do is a normal load and just use offsets into the array (or std::vector would be my prefered option) to get the data ( assuming rgb and data is an unsigned char *, data[0] = red, data[1] = green, data[2] = blue, data[3] = red, etc etc)you could probably convince it to load into a 2d array ([xsize][ysize] i think, althought i''m not sure how cache friendly that is) and have the second element as a struct with r,g,b and maybe alpha components which you could just access as data[row][column].x etc