display::scoped_ortho::scoped_ortho(display & parent) : parent(parent) { parent.bind(); glMatrixMode(GL_PROJECTION); glPushMatrix(); CHECK_GL_ERRORS(); glLoadIdentity(); CHECK_GL_ERRORS(); glOrtho(0, static_cast<float>(parent.get_width()), 0, static_cast<float>(parent.get_height()), -1, 1); } // display::scoped_orth::scoped_orth()
display::scoped_viewport::scoped_viewport(display & parent) : parent(parent) { parent.bind(); glViewport(0, 0, parent.get_width(), parent.get_height()); } // display::scoped_viewport::scoped_viewport()