Jump to content
  • Advertisement
Sign in to follow this  
nickme

glut: when i re-glOrtho2D() the viewport becomes smaller.

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

hi,

when i re-execute glOrtho2D() in my program again, the window was the same but the picture became smaller. is there a way to change the coordinate in the program after the glOrtho2D had already executed once? i can keep the old glOrtho2D coordinate and map the new coordinate to display, but that seems inefficient and i want glut to do it itself and it might lost some precision after my mapping.

any idea?

thanks.

Share this post


Link to post
Share on other sites
Advertisement
There is nothing stopping you from calling the function multiple times, and if it doesn't do what you want, then you are passing incorrect parameters to it. The function itself is not broken, but your code is.

Share this post


Link to post
Share on other sites

There is nothing stopping you from calling the function multiple times, and if it doesn't do what you want, then you are passing incorrect parameters to it. The function itself is not broken, but your code is.


hi,
i know that there is problem with my program. but after the following statement:

gluOrtho2D(left, right, bottom, top);

if i execute the same statement again, i got a picture that is smaller. i loaded the identity and clear the matrix before calling the gluOrtho2D, it's not as small, but nevertheless, smaller. it would work for me if no matter how many times i execute the statement, the picture should be the same, because it just reset the coordinates, right?

let say if i want to magnify the image and zoom in to show more finer detail of a graph, all i have to do is to execute the gluOrtho2D again with the following statement.

gluOrtho2D(left*0.1, right,*0.1 bottom*0.1, top*0.1);

but it did not work. what can i do?

thanks

Share this post


Link to post
Share on other sites
hi,

finally, i got it to work. all i have to do is glMatrixMode(GL_PROJECTION); before glLoadIdentity().

bye.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!