00001 #include <gl/glut.h> 00002 #include "Viewport.h" 00003 00004 void ViewPort::setViewPort() { 00005 glPushAttrib(GL_VIEWPORT_BIT); 00006 glViewport(this->x, this->y, this->w, this->h); 00007 } 00008 00009 00010 void ViewPort::setViewPort(int x, int y, int w, int h) { 00011 this->x = x; 00012 this->y = y; 00013 this->w = w; 00014 this->h = h; 00015 glPushAttrib(GL_VIEWPORT_BIT); 00016 glViewport(this->x, this->y, this->w, this->h); 00017 } 00018 00019 00020 void ViewPort::resetViewPort() { 00021 glPopAttrib(); 00022 } 00023 00024 void ViewPort::flipYAxis(int &y) { 00025 this->y = this->h - this->y; 00026 }