I am having some trouble with full screen mode. I can set my window to be 800×600, but when I full screen that resolution, it stretches. I assume this is because of a change in aspect ratio. How can I fix this?
Edit #1
Here’s a screen shot of what I see happening.
Left: 800×600
Right: 1366×768
Edit #2
My initGraphics function gets called every time I re-size the window (WM_SIZE).
void initGraphics(int width, int height) {
float aspect = (float)width / (float)height;
glViewport(0, 0, width, height);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND); //Enable alpha blending
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glClearColor(0.0, 0.0, 0.0, 1.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0, width, height * aspect, 0.0);
glMatrixMode(GL_MODELVIEW);
}

SOLUTION:
The real problem ended up being that you were misusing the gluOrtho2D function. Instead of using this:
You needed to switch it to the correct form this:
The latter creates a 2D orthographic projection, that fills the entire width and height of your viewport, so no stretching occurs.
ORIGINAL ANSWER:
You need to modify your projection in order to account for the new aspect ratio.
Make sure you first of all set
glViewportto the new window size. After the viewport is set you will need to switch your matrix mode to projection with a call toglMatrixModeand then finally calculate your new aspect ratio withwidth / heightand pass the new aspect ratio togluPerspective. You can also use straightglFrustuminstead ofgluPerspectiveyou can find source togluPerspectiveto achieve that same effect withglFrustum.Something like this: