PDA

View Full Version : reading image from memory to buffer to screen



lepp
06-19-2002, 09:14 AM
I am a complete newbie. I have read a sun raster image from the disk to memory. I now need to read the image to the buffer and from the buffer to the screen. I am lost here. I have looked at some gl functions such as glReadPixels() but this reads from the buffer to the processor. I am a little confused. What functions do I need to use to get the image from memory to the buffer and then from the buffer to the screen?

mikael_aronsson
06-19-2002, 09:26 AM
Hi !

When you have read in the image file into a buffer in ram you can use glDrawPixels to copy the image from the memory buffer to the OpenGL "window", you do need to setup the projection and modelview matrix correct, if you have a look at the OpenGL faq on this websiet you will find more information about it.

Mikael

lepp
06-19-2002, 10:14 AM
once I read the sun raster to memory from disk, do I need to copy it to a back buffer or can I display it directly from memory?

lepp
06-19-2002, 10:26 AM
I read the faq and think I have figured it out. Thanks