Commit ca9267e7 authored by Andreas Neu's avatar Andreas Neu

Added Controller StateControl for the OpenGL Object State.

parent 3aff0add
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2011, Computer Graphics Group RWTH Aachen University //
// All rights reserved. //
////////////////////////////////////////////////////////////////////////////////
#ifndef ACGL_OPENGL_CONTROLLER_STATECONTROL_HH
#define ACGL_OPENGL_CONTROLLER_STATECONTROL_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 StateeControl : public Resource::BasicCreateController<Texture>
{
// ========================================================================================================= \/
// ============================================================================================ CONSTRUCTORS \/
// ========================================================================================================= \/
public:
StateControl(void)
: mpVertexBuffer(NULL),
mpFrameBuffer(NULL),
mpShaderProgram(NULL)
{}
virtual ~StateControl(void) {}
// ==================================================================================================== \/
// ============================================================================================ METHODS \/
// ==================================================================================================== \/
public:
inline StateControl& vertexBuffer (ConstSharedVertexBuffer _vertexBuffer) { mpVertexBuffer = _vertexBuffer; return *this; }
inline StateControl& frameBuffer (ConstSharedFrameBuffer _frameBuffer) { mpFrameBuffer = _frameBuffer; return *this; }
inline StateControl& shaderProgram (ConstSharedShaderProgram _shaderProgram) { mpShaderProgram = _shaderProgram; return *this; }
// ===================================================================================================== \/
// ============================================================================================ OVERRIDE \/
// ===================================================================================================== \/
public:
virtual SharedState create(void)
{
SharedState state(new State(mpVertexBuffer, mpFrameBuffer, mpShaderProgram));
return state;
}
// =================================================================================================== \/
// ============================================================================================ FIELDS \/
// =================================================================================================== \/
protected:
ConstSharedVertexBuffer mpVertexBuffer;
ConstSharedFrameBuffer mpFrameBuffer;
ConstSharedShaderProgram mpShaderProgram;
};
} // OpenGL
} // ACGL
#endif // ACGL_OPENGL_CONTROLLER_TEXTURECONTROL_HH
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment