Storing data in buffer


I want to store image data in auxiliary buffer in order to draw them faster to color buffer (I’m using glCopyPixels). My problem is the glRasterPos* function? If I want to store data at position (0, 0) it might be that this does not corresponed with color buffer and I’m getting a invalid rater position. I don’t understand how data is stored in buffers at all!! Why can’t i get a pointer to a buffer??

Can anyone help me?

Many thanks

You can’t get a pointer to a buffer because OpenGL is a client/server model. Typically, for performance, graphics cards will swizzle their actual internal buffers anyway, so a pointer wouldn’t do you much good without intimate internal knowledge of the specific hardware.

The best performance in getting pixels onto the screen is usually had by storing the pixels in a texture, and drawing a single quad with that texture applied, and GL_NEAREST filtering mode.

Thanks jwatte for answering, i will try doing that…

regards Jupp

It’s also a good idea to use mipmaps to make use of any texture caches (lookups for a minified texture are close in a mipmap but spread out in a non-mipmapped texture).