OpenGL image flip / coordinate system question

Basically, I am being forced to use OpenGL to do my drawing (by a 3rd party application that I cannot avoid), and I am being handed a byte buffer containing an image that constantly changes that I need to paint on the screen.

The issue I am having is that the origin (0,0) for OpenGL is in the lower left corner of the screen while the origin for the image is in the upper left. When I paint it the way I have been drawing the png files I am loading from disk, the image is flipped vertically.

I have attempted glScalef(width, -height, 0), but nothing draws.
I have attempted using glOrtho to move the origin for OpenGL, which works for all of the lines/polygons I am drawing, but not for the images. In order to get the images to display after the glOrtho manipulation, I have to call glScalef(width, -height, 0) and then the image is still upside down.

I am still very new to OpenGL, can anyone point me towards a solution?

Thanks,
Tim

If you’re drawing the images with quads and texture coordinates, just flip which vertex in the quad has the vertical texture coord 0 and 1. You don’t need to change the s coordinates at all, just flip the t (not scale, though).

That worked! Many thanks.