   fast pixelplotting in opengl
  If you have a large 2dimensional array of color values (a bitmap without a ''real'' bitmap type, if you will), what is a fast way of drawing this data?I have a +/- 600x600 array of RGB values, that changes some of the time, but contains the same static ''image'' most of the time. How can I draw this image using opengl, without having to set the color and plot the pixels individually for each pixel, each frame?There must be a way to convert such an image to an actual opengl image, and to plot the image with a simple glDrawPixels call. But how do I get from this:struct RGB { float r,g,b }RGB image[600][600]// set individual colors in the imageto a proper opengl image which i can draw with glDrawPixels instead of using glBegin(GL_POINTS) ... glEnd() to draw individual pixels (with glColor() calls in between) ? 
  glBegin(GL_POINTS) is suicide.  The most common way to do this is to use textured quads:1. Create a new 2D texture using your RGB values.2. Create a quad with appropriate texture coordinates.3. Render the quad.Your image dimension can be any size, but the texture dimensionshould be powers of 2.Look up these calls: glGenTextures(), glBindTexture(),glTexImage2D(), glDeleteTextures() on how to use them.Good Luck!   Kami no Itte ga ore ni zettai naru! ;  Alright, texture mapping is one thing, but since I''m always drawing the image in 2d, it is probably easier to use the glDrawPixels function. The only problem is that glDrawPixels asks for a bunch of pixels of a given GL type and format, and my array of ''pixels'' probably doesnt conform to this type and format.I know how to do texture mapping using bmps or tga''s for example. What I don''t know is how to get from an array of ''pixels'' (containing int R, G and B for each pixel) to a valid GLenum type and format. What I would like to do is callglDrawPixels(width, height, GL_RGB, GL_UNSIGNED_BYTE, myImageData);but the image data I currently have looks like this:struct RGB { int r,g,b }RGB image[width][height]and I dont know how to convert this 2d array of rgb values to a valid array to pass to the glDrawPixels function as myImageData. ;  You may just pass GL_UNSIGNED_INT (or something like that)instead of GL_UNSIGNED_BYTE and than pass your arrayp.s. a 2d array is a 1d array internale.g. a[x][y]=a[x*maxy+y]CHE ;  I am sure you know, but I thought I should reiterate the warning... glDrawPixels can be unbeliavably slow on some systems (depends on driver, ie 640x480 glDrawPixels per frame of blank screen=1 fps). In other words, it can be unusably slow. If you need to transfer a fixed image to screen many times (and even a depth/stencil buffer I think) you could try the region buffer extension, which gives a fast mechanism for transfering an image (and depth/stencil buffer too). To cut a long story short, draw on textured quads, and blit to screen. ;  Why not use an interpolation algorithm?  First write a function that takes three arguments, like so:GenSubbedQuad(GLfloat rows, GLfloat colums, GLfloat ** colordata){}so GenSubbedQuad(3,3,whatever) draws something like this:OOOOOOOOOWhere each 0 is a quad, and the Nth vertex in the Xth row is colored colordata[X][N].Then you simply run a function that divides your data into (rows * colums) chunks, and takes the average of each chunk....call it GLfloat ** Interpolate(GLfloat chunksX, chunksY, GLfloat ** source_data).Then you just go GenSubbedQuad(3,3,Interpolate(3,3,array)), and make sure you store the result in a display list if it doesn''t change.  Also, you can boost performance by running the update loop on a timer and screwing with the update interval...you probably wouldn''t notice drawing at 60fps and updating at 20fps, but that might make the difference in it running or not running. 