PDA

View Full Version : display image in reverse order



jayaprakash
02-03-2009, 04:29 AM
Hi all,

I would like to display image in reverse order(bottom to top) because i am getting reversed image buffer, is there any direct option in openGL except copy the image buffer in reverse order to another buffer and use that buffer.

Thanks & Regards,
Jayaprakash

_NK47
02-03-2009, 07:31 AM
i think (think!) glPixelZoom does that if your glDrawPixel them but you haven't mentioned how you display them.

jayaprakash
02-03-2009, 08:27 AM
Thanks for your reply.
I am displaying using
glDrawPixels(width,height,GL_BGR_EXT,GL_UNSIGNED_B YTE,image_rgb);

but my image_rgb pointer is conataining data in reversed order.

I was trying to use glPixelZoom(1.0, -1.0) instead of glPixelZoom(1.0, 1.0) then i am not able to wiev the image at all.
Can we pass -ve width/height to glDrawPixels? so that I think we get it in reverse order.
please give suggesions.

Thanks & Regards,
Jayaprakash

_NK47
02-03-2009, 10:28 AM
i really haven't used glDrawPixels for a long time. its all slow and deprecated. if you can use textures instead i advice you to do so. you can draw images with just two triangles (quad) with the texture on top with proper transformation like rotation or scaling. it is also hardware accelerated.