Jump to content
  • Advertisement
Sign in to follow this  
ms75214

opengl 2d

This topic is 2656 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there a good example (nehe?) of how to do 2d sprites and what not on opengl??

i'm guessing the setup is something like this...

glMatrixMode( GL_PROJECTION );
glPushMatrix( );
glLoadIdentity( );
glOrthox(
0, _INT2FIXED(glutGet( GLUT_WINDOW_WIDTH )),
_INT2FIXED(glutGet( GLUT_WINDOW_HEIGHT )), 0,
_INT2FIXED(-1), _INT2FIXED(1)
);

glMatrixMode( GL_MODELVIEW );
glPushMatrix( );
glLoadIdentity( );

Share this post


Link to post
Share on other sites
Advertisement
Hi!

Why do you call glPushMatrix() that often?

It seems that you want to setup the projection so that the coordinates maps the pixels coordinate of the screen.
This would be the way to go, to mange sprite.

To render your sprites, you can apply then as a texture to a quad.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!