PDA

View Full Version : invert drawing pixels?



gpu_hpc
01-27-2010, 11:35 PM
Hi

I have written a small openGL program to display image continously means dat 6000*6000 size image is displayed as 512 * 512 at a time. I created display window of size 512 * 512 and my display function is as simple as the following,

display()
{
glClear(GL_COLOR_BUFFER_BIT);

glDisable(GL_DEPTH_TEST);

glRasterPos2i(0, 0);
glDrawPixels(512, 512 GL_RGBA, GL_UNSIGNED_BYTE, img);
glutSwapBuffer();

glutPostRedisplay();
}

I understand dat as the raster position is set to (0,0), the display will start from top to bottom as we see. To start the display from bottom, i changed raster pos to (512,512). But I dont get any display.
I added glPixelZoom(-1,-1) just before setting raster pos. But the effect was nothing. What should I do to get display from bottom of the screen?

thanks