View Full Version : why
ReadJPEG("1.jpg", &pixels, &w, &h, &c);
after i readin the image, why is it upside down? how can i flip it to normal view version? how can i flip it vertically and horizontally? thanks for helping.
How do you use it, and how do you know it's up side down? It can be your code that draws the image in the wrong way, or are you completely sure that this one is correct?
One possible way can be that if you use it as a texture, make sure you have the origin in the right place. In OpenGL, the origin is in the lower left corner, and not the upper left as one would think.
[This message has been edited by Bob (edited 03-03-2001).]
03-03-2001, 04:10 PM
If you do need to flip the data, you simply need to do a pair of nested for loops that swaps the pixels from start to end. If you're not sure how to do this, I'd suggest learning C/C++ better before jumping into OpenGL.
why dont you just draw it upside down....
(or right side up in this case)
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.