I am new to opensgl. I am able to display my image using glDrawPixel(w,h,…);
the problem is the picture is upside down? Any suggestion.
I appreciate the help

Turn the picture upside down. Many image formats store the image bottom up so you need to flip the image.

image2[((image_height - x)y) + x] = image[ (xy) + x];

or something along those lines if you see what I mean.