| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- #include "Base.h"
- #include "Viewport.h"
- namespace gameplay
- {
- Viewport::Viewport()
- {
- }
- Viewport::Viewport(int x, int y, int width, int height)
- {
- set(x, y, width, height);
- }
- Viewport::Viewport(const Viewport& viewport)
- {
- set(viewport);
- }
- Viewport::~Viewport()
- {
- }
- void Viewport::set(int x, int y, int width, int height)
- {
- _x = x;
- _y = y;
- _width = width;
- _height = height;
- }
- void Viewport::set(const Viewport& viewport)
- {
- _x = viewport._x;
- _y = viewport._y;
- _width = viewport._width;
- _height = viewport._height;
- }
- int Viewport::getX() const
- {
- return _x;
- }
- void Viewport::setX(int x)
- {
- _x = x;
- }
- int Viewport::getY() const
- {
- return _y;
- }
- void Viewport::setY(int y)
- {
- _y = y;
- }
- int Viewport::getWidth() const
- {
- return _width;
- }
- void Viewport::setWidth(int width)
- {
- _width = width;
- }
- int Viewport::getHeight() const
- {
- return _height;
- }
- void Viewport::setHeight(int height)
- {
- _height = height;
- }
- void Viewport::bind()
- {
- GL_ASSERT( glViewport(_x, _y, _width, _height) );
- }
- }
|