Clipped view of projection

Started by
3 comments, last by versus5 14 years, 5 months ago
Hi, does anyone know how to have a clipped view of mainwindow in subwindow ?
Advertisement
glViewport should do the trick, if I understand correctly what you want to achieve.
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]
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?
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]

This topic is closed to new replies.

Advertisement