arsd icon indicating copy to clipboard operation
arsd copied to clipboard

Normalize Window corrdinates

Open Aphexus opened this issue 7 years ago • 1 comments

Was trying to get some graphics going and was confused by things being off...

Seems your code doesn't set the openGL window to be that of the viewport by default.

This code fixes it. glViewport(0, 0, cast(int)window.Width, cast(int)window.Height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0, window.Width, -window.Height, 0, -1, 1); glScalef(1.0f, -1.0f, 1.0f);

Aphexus avatar Oct 08 '18 13:10 Aphexus

Are you using the gamehelpers.d create2dWindow function?

simpledisplay by itself doesn't create any matrix, but it does call glViewport after window resizes.

adamdruppe avatar Oct 08 '18 13:10 adamdruppe