Jump to content
  • Advertisement
Sign in to follow this  
versus5

Clipped view of projection

This topic is 3172 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

Advertisement
My ReshapeFunc function looks like this - but it isn't working well

void reshape(int w,int h)
{
GLfloat aspectRatio;
if(h==0) h=1;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glViewport (0, 100, (GLsizei) w, (GLsizei) h);
gluOrtho2D(0, 800, 0, 500 );

//small clipped view
//--this part is not working>
glLoadIdentity();
glViewport (0, 0, 100, 100);
gluOrtho2D(0, 800, 0, 500 );
//--this part is not working <

glFlush();
}






[Edited by - versus5 on November 11, 2009 7:52:47 PM]

Share this post


Link to post
Share on other sites
You're passing a width value of 0 into glViewport, that's probably not what you want.

Also, why are you setting the viewport/ortho matrix, and then immediately overwriting those settings?

Share this post


Link to post
Share on other sites
The whole code

Sure, my mistake, but after changing width into e.g. 100 the big image doesn't apearing in previous viewport. It shows only the small view.

[Edited by - versus5 on November 12, 2009 7:59:52 AM]

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!