Open Aphexus opened 5 years ago
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);
Are you using the gamehelpers.d create2dWindow function?
simpledisplay by itself doesn't create any matrix, but it does call glViewport after window resizes.
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);