Sign in to follow this  

Full screen stretching image

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

I currently use 950 by 950 resolution and i get a nice even shape to things but if i use the fullscreen mode.....
	glutGameModeString("1680x1050:32@60"); 
	glutEnterGameMode(); 

everything becomes stretched and a sphere in my scene no longer looks like a sphere, do i need to increase the viewport size rather than the image or something like that? Here is my reshape function.
void reshape(int w1, int h1)
{
	//Prevents a divide by zero when the windows too short
	if(h1 == 0)
	{
		h1 = 1;
	}

	w = w1;
	h = h1;
	ratio = 1.0f * w / h;

	// Reset the coordinate system before modifying
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	
	// Set the viewport to be the entire window
    glViewport(0, 0, w, h);

    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluPerspective(55, 1.0, 0.1, 1030);
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
}

Many Thanks.

Share this post


Link to post
Share on other sites
gluPerspective expects an apsect ratio for the second parameter. You have 1.0, which means that the width of the window will have the same field of view as the height. You most likely want 'ratio' there.

Share this post


Link to post
Share on other sites

This topic is 3317 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this