Skip to content
Snippets Groups Projects
Commit 13a23dc2 authored by Lars Krecklau's avatar Lars Krecklau
Browse files
parents 0545b116 d9597799
No related branches found
No related tags found
No related merge requests found
......@@ -31,5 +31,6 @@
#include <ACGL/OpenGL/Controller/UniformControl.hh>
#include <ACGL/OpenGL/Controller/VertexBufferObjectControl.hh>
#include <ACGL/OpenGL/Controller/VertexBufferObjectControlFileOBJ.hh>
#include <ACGL/OpenGL/Controller/ViewportControl.hh>
#endif // ACGL_OPENGL_CONTROLLER_HH
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2011, Computer Graphics Group RWTH Aachen University //
// All rights reserved. //
////////////////////////////////////////////////////////////////////////////////
#ifndef ACGL_OPENGL_CONTROLLER_VIEWPORTCONTROL_HH
#define ACGL_OPENGL_CONTROLLER_VIEWPORTCONTROL_HH
#include <ACGL/ACGL.hh>
#include <ACGL/Resource/BasicCreateController.hh>
#include <ACGL/OpenGL/Objects/State.hh>
#include <ACGL/OpenGL/GL.hh>
namespace ACGL{
namespace OpenGL{
class ViewportControl : public Resource::BasicCreateController<Viewport>
{
// ========================================================================================================= \/
// ============================================================================================ CONSTRUCTORS \/
// ========================================================================================================= \/
public:
ViewportControl()
: mOffsetX(0),
mOffsetY(0),
mWidth(0),
mHeight(0)
{}
virtual ~ViewportControl(void) {}
// ==================================================================================================== \/
// ============================================================================================ GETTERS \/
// ==================================================================================================== \/
public:
inline ViewportControl& offset (GLint _offsetX, GLint _offsetY)
{
mOffsetX = _offsetX;
mOffsetY = _offsetY;
return *this;
}
inline ViewportControl& size (GLsizei _width, GLsizei _height)
{
mOffsetX = _width;
mOffsetY = _height;
return *this;
}
// ===================================================================================================== \/
// ============================================================================================ OVERRIDE \/
// ===================================================================================================== \/
public:
virtual SharedViewport create(void)
{
SharedViewport viewport(new Viewport(mOffsetX, mOffsetY, mWidth, mHeight));
return viewport;
}
// =================================================================================================== \/
// ============================================================================================ FIELDS \/
// =================================================================================================== \/
protected:
GLint mOffsetX;
GLint mOffsetY;
GLsizei mWidth;
GLsizei mHeight;
};
} // OpenGL
} // ACGL
#endif // ACGL_OPENGL_CONTROLLER_TEXTURECONTROL_HH
......@@ -45,6 +45,7 @@ typedef Resource::FileManager<Texture> TextureFileManager;
typedef Resource::NameManager<VertexBufferObject> VertexBufferObjectNameManager;
typedef Resource::FileManager<VertexBufferObject> VertexBufferObjectFileManager;
typedef Resource::NameManager<Viewport> ViewportNameManager;
} // OpenGL
} // ACGL
......
......@@ -27,10 +27,10 @@ class Viewport
// ============================================================================================ CONSTRUCTORS \/
// ========================================================================================================= \/
public:
Viewport(int _offsetX,
int _offsetY,
int _width,
int _height)
Viewport(GLint _offsetX,
GLint _offsetY,
GLsizei _width,
GLsizei _height)
: mOffsetX(_offsetX),
mOffsetY(_offsetY),
mWidth(_width),
......@@ -43,10 +43,10 @@ public:
// ============================================================================================ GETTERS \/
// ==================================================================================================== \/
public:
inline int getOffsetX (void) const { return mOffsetX; }
inline int getOffsetY (void) const { return mOffsetY; }
inline int getWidth (void) const { return mWidth; }
inline int getHeight (void) const { return mHeight; }
inline GLint getOffsetX (void) const { return mOffsetX; }
inline GLint getOffsetY (void) const { return mOffsetY; }
inline GLsizei getWidth (void) const { return mWidth; }
inline GLsizei getHeight (void) const { return mHeight; }
// ==================================================================================================== \/
// ============================================================================================ METHODS \/
......@@ -61,10 +61,10 @@ public:
// ============================================================================================ FIELDS \/
// =================================================================================================== \/
protected:
int mOffsetX;
int mOffsetY;
int mWidth;
int mHeight;
GLint mOffsetX;
GLint mOffsetY;
GLsizei mWidth;
GLsizei mHeight;
};
ACGL_SHARED_TYPEDEF(Viewport)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment