glOrtho, textures upside down, on some drivers not? (NOT SOLVED)

Started by
15 comments, last by Lord Myth 19 years, 3 months ago
this is my third bump now... does nobody know anything about this?
Advertisement
Quote:Original post by Gooberius
I'm not sure how well this applies to OpenGL, but it's recommended for D3D that you don't rely on any default state in the API. If you expect a default state then you should explicitly set it on application startup. It used to be the case that many drivers forgot to initialise certain values when the API was initialised, so you could get varying results depending on the order of doing things and suchlike.

As I say, not sure how that compares to GL drivers, but it's worth keeping in mind sometimes.


...and I quote Gooberius :)...
I presume your GL init is OK otherwise you will see nothing.
I think the problem is in your rendering function...can you post a short code fragment in which you describe how you draw a textured quad?
And if you change

gluOrtho2D(0, WindowWidth, WindowHeight, 0);

to

gluOrtho2D(0, WindowWidth, 0, WindowHeight); ?

( gluOrtho2D(left,right,bottom,top) )
then the coordinates do not start on top left anymore you know... but I'll see what it does.
[EDIT:] yep, everything is just flipped upside down, as it should, nothing changed

[Edited by - LordMyth on January 5, 2005 9:59:02 AM]
try using a replacement for gluOrtho2D, something like this:

glViewport( 0, 0, width, height );
glMatrixMode( GL_PROJECTION );
glLoadIdentity( );
glOrtho( 0, width, height, 0, -1, 1 );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity( );
Another one on this forum had similar problems. His was due to different versions(or somtheing) of the DevIL library.
If you are using DevIL, put this after your init-code (before you load anything):
	ilOriginFunc(IL_ORIGIN_UPPER_LEFT);	ilEnable(IL_ORIGIN_SET);

If you don't use DevIL.. well, I would still check the loading code,
good luck!
I use DevIL, and I saw the topic too, I corrected the code and I sent it to my friend. He still didn't answer yet, so I don't really know what it will do...

This topic is closed to new replies.

Advertisement