Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Flipping x,y axes in OpenGL

$
0
0
I want to flip the y axis in OpenGL to look like PyGame, where (0,0) is the top left corner and (0, height) is the lower left corner.
Is this possible?

This is how I initialize graphics:
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
gluOrtho2D(0, w, 0, h)
glMatrixMode(GL_MODELVIEW)


My definition of Quads:
glBegin(GL_QUADS)
glTexCoord2f(0,0); glVertex2f(0,0)
glTexCoord2f(0,1); glVertex2f(0,height) 
glTexCoord2f(1,1); glVertex2f(width, height)
glTexCoord2f(1,0); glVertex2f(width, 0)
glEnd()

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>