#include <framebuffer.h>
Public Member Functions | |
virtual void | attach (const Texture *texture)=0 |
Attach Texture to FrameBuffer. | |
void | bind () |
Bind our object. | |
virtual void | detach (const Texture *texture)=0 |
Detach Texture from FrameBuffer. | |
virtual void | drawBuffer (const Texture *RenderTarget)=0 |
Set render destination. | |
FrameBuffer (const std::string &FrameBufferClassName, const std::string &FrameBufferName, GraphicCore *graphiccore) | |
const std::string & | getClassName () const |
Returns name of class of our object. | |
virtual void | getData (Data &to, const Texture *from)=0 |
get results from GPU side to CPU side | |
const std::string & | getObjectName () const |
Returns name of our object. | |
void | getSpecificParameter (const std::string &ParameterName, void *ParameterValue) |
Method for obtaining some specific parameters, such as texture specific params, and so on. | |
virtual void | initialize ()=0 |
bool | isActive () const |
bool | isLocked () const |
returns state of object. | |
void | unbind () |
Unbind our object. | |
virtual | ~FrameBuffer () |
Protected Member Functions | |
void | addSpecificParameter (const std::string &ParameterName, void *ParameterValue, size_t Size) |
void | lock () |
void | unlock () |
Protected Attributes | |
GraphicCore * | mDefaultGraphicCore |
Also this class will be used in "Ping - Pong" techinque, when result of previous computation is an input data for next computation.
Definition at line 50 of file framebuffer.h.
gpucalc::FrameBuffer::FrameBuffer | ( | const std::string & | FrameBufferClassName, | |
const std::string & | FrameBufferName, | |||
GraphicCore * | graphiccore | |||
) | [inline] |
Definition at line 57 of file framebuffer.h.
00057 : 00058 Object(FrameBufferClassName, FrameBufferName), Bindable(FrameBufferClassName, FrameBufferName), mDefaultGraphicCore(graphiccore) 00059 { 00060 }
virtual gpucalc::FrameBuffer::~FrameBuffer | ( | ) | [inline, virtual] |
void gpucalc::Object::addSpecificParameter | ( | const std::string & | ParameterName, | |
void * | ParameterValue, | |||
size_t | Size | |||
) | [inline, protected, inherited] |
Definition at line 254 of file object.h.
00255 { 00256 SpecificParametersMap::iterator i = mSpecificParameters.find(ParameterName); 00257 if (i != mSpecificParameters.end()) 00258 { 00259 mSpecificParameters.erase(i); 00260 } 00261 mSpecificParameters[ParameterName] = Any(ParameterValue, Size); 00262 }
virtual void gpucalc::FrameBuffer::attach | ( | const Texture * | texture | ) | [pure virtual] |
Attach Texture to FrameBuffer.
texture | - Texture for rendering into it, or reading data. |
Implemented in gpucalc::GLFrameBuffer.
void gpucalc::FrameBuffer::bind | ( | ) | [inline, virtual] |
Bind our object.
For example, set in some active state (Texture, Shader and so on)
Implements gpucalc::Bindable.
Definition at line 107 of file framebuffer.h.
00108 { 00109 mDefaultGraphicCore->bind(this); 00110 }
virtual void gpucalc::FrameBuffer::detach | ( | const Texture * | texture | ) | [pure virtual] |
Detach Texture from FrameBuffer.
texture | - Texture for rendering into it, or reading data. |
Implemented in gpucalc::GLFrameBuffer.
virtual void gpucalc::FrameBuffer::drawBuffer | ( | const Texture * | RenderTarget | ) | [pure virtual] |
Set render destination.
RenderTarget | - texture for rendering into it. |
Implemented in gpucalc::GLFrameBuffer.
const std::string& gpucalc::Object::getClassName | ( | ) | const [inline, inherited] |
Returns name of class of our object.
Definition at line 92 of file object.h.
00093 { 00094 return mClassName; 00095 }
get results from GPU side to CPU side
to | - contains pointer to data in CPU-side memory and other useful members. | |
from | - rendering target. |
Implemented in gpucalc::GLFrameBuffer.
const std::string& gpucalc::Object::getObjectName | ( | ) | const [inline, inherited] |
Returns name of our object.
Definition at line 101 of file object.h.
00102 { 00103 return mObjectName; 00104 }
void gpucalc::Object::getSpecificParameter | ( | const std::string & | ParameterName, | |
void * | ParameterValue | |||
) | [inline, inherited] |
Method for obtaining some specific parameters, such as texture specific params, and so on.
ParameterName | - name of parameter, usually it similar to specific method of some object (for example, GLTextureID) | |
ParameterValue | - contain value of named parameter, it must be allocated and have sufficient size. |
Definition at line 128 of file object.h.
00129 { 00130 SpecificParametersMap::iterator i = mSpecificParameters.find(ParameterName); 00131 if (i != mSpecificParameters.end()) 00132 { 00133 i->second.copyValue(ParameterValue); 00134 } 00135 else 00136 { 00137 Except<ERR_ITEM_NOT_FOUND>(this, "Parameter \"" + ParameterName + "\" does not exists.", "Object::getSpecificParameter()", __FILE__, __LINE__); 00138 } 00139 }
virtual void gpucalc::FrameBuffer::initialize | ( | ) | [pure virtual] |
Implemented in gpucalc::GLFrameBuffer.
bool gpucalc::FrameBuffer::isActive | ( | ) | const [inline, virtual] |
Implements gpucalc::Bindable.
Definition at line 119 of file framebuffer.h.
00120 { 00121 return (this == mDefaultGraphicCore->getActiveFrameBuffer()); 00122 }
bool gpucalc::Object::isLocked | ( | ) | const [inline, inherited] |
void gpucalc::Object::lock | ( | ) | [inline, protected, inherited] |
void gpucalc::FrameBuffer::unbind | ( | ) | [inline, virtual] |
Unbind our object.
For example, set in some inactive state (Texture, Shader and so on)
Implements gpucalc::Bindable.
Definition at line 113 of file framebuffer.h.
00114 { 00115 mDefaultGraphicCore->unbind(this); 00116 }
void gpucalc::Object::unlock | ( | ) | [inline, protected, inherited] |
GraphicCore* gpucalc::FrameBuffer::mDefaultGraphicCore [protected] |
Definition at line 125 of file framebuffer.h.