#include <graphic_core.h>
Public Member Functions | |
virtual void | addAcceptableShaderSystemID (const std::string &ShaderSystemID)=0 |
Method for manual adding acceptable ShaderSystem ID. | |
virtual void | bind (FrameBuffer *framebuffer)=0 |
virtual void | bind (Texture *texture)=0 |
virtual void | checkErrors (const std::string &where)=0 |
Perform error checking. | |
virtual FrameBuffer * | create (const std::string &FrameBufferName)=0 |
Creates FrameBuffer with given name. | |
virtual Texture * | create (const std::string &TextureName, TextureUsage Usage)=0 |
Creates Texture with given name and type of usage. | |
virtual void | destroy (FrameBuffer *fb)=0 |
Delete framebuffer and free memeory in GPU-side. | |
virtual void | destroy (Texture *texture)=0 |
Delete texture and free memory in GPU-side. | |
virtual void | draw (float TexCoordX, float TexCoordY)=0 |
Draw quad with given texture coords. | |
virtual FrameBuffer * | getActiveFrameBuffer () const =0 |
Returns active FrameBuffer. | |
virtual Texture * | getActiveTexture () const =0 |
const std::string & | getClassName () const |
Returns name of class of our object. | |
virtual FrameBuffer * | getFrameBufferByName (const std::string &FrameBufferName) const =0 |
Finds and return previously created FrameBuffer. | |
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 Texture * | getTextureByName (const std::string &TextureName) const =0 |
Finds and return previously created Texture. | |
virtual Vendor | getVendor () const =0 |
Returns vendor type. | |
GraphicCore (const std::string &GraphicCoreName) | |
virtual void | initialize (const Data &data, Texture &texture)=0 |
Reinitalizes previously created texture with new Data. | |
virtual bool | isAcceptSystem (const ShaderSystem *System) const =0 |
Check for ShaderSystem acceptance. | |
virtual bool | isFrameBufferCreated (const std::string &FrameBufferName) const =0 |
Check for existence. | |
bool | isLocked () const |
returns state of object. | |
virtual bool | isTextureCreated (const std::string &TextureName) const =0 |
Check for existence. | |
virtual int | maxFramebufferAttachmentPoints () const =0 |
Returns maximal number of attachment points. | |
virtual int | maxTextureSize () const =0 |
Returns maximal size of texture. | |
virtual void | setMatrixMode (float Width, float Height)=0 |
Setting up model view matrices, setting up viewport for correct rendering quad. | |
virtual void | start (int argc, char *argv[])=0 |
Starts our GraphicCore. | |
virtual void | stop ()=0 |
Stops our GraphicCore. | |
virtual void | unbind (FrameBuffer *framebuffer)=0 |
virtual void | unbind (Texture *texture)=0 |
virtual | ~GraphicCore () |
Protected Member Functions | |
void | addSpecificParameter (const std::string &ParameterName, void *ParameterValue, size_t Size) |
void | lock () |
void | unlock () |
It can create textures, framebuffer objects, has list of available ShaderSystem s, and has numerous methods for rendering and controlling state of rendering API. All operations with GraphicCore must be after calling method GraphicCore::start() and before calling method GraphicCore::stop().
Definition at line 83 of file graphic_core.h.
gpucalc::GraphicCore::GraphicCore | ( | const std::string & | GraphicCoreName | ) | [inline] |
Definition at line 92 of file graphic_core.h.
00092 : 00093 Object(_GraphicCoreClassName, GraphicCoreName) 00094 { 00095 }
virtual gpucalc::GraphicCore::~GraphicCore | ( | ) | [inline, virtual] |
virtual void gpucalc::GraphicCore::addAcceptableShaderSystemID | ( | const std::string & | ShaderSystemID | ) | [pure virtual] |
Method for manual adding acceptable ShaderSystem ID.
This method is useful when we use specific ShaderSystem with ID different from standart ids.
Implemented in gpucalc::GLGraphicCore.
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::GraphicCore::bind | ( | FrameBuffer * | framebuffer | ) | [pure virtual] |
Implemented in gpucalc::GLGraphicCore.
virtual void gpucalc::GraphicCore::bind | ( | Texture * | texture | ) | [pure virtual] |
Implemented in gpucalc::GLGraphicCore.
virtual void gpucalc::GraphicCore::checkErrors | ( | const std::string & | where | ) | [pure virtual] |
Perform error checking.
where | - string contains name of function, which calls this method. |
Implemented in gpucalc::GLGraphicCore.
virtual FrameBuffer* gpucalc::GraphicCore::create | ( | const std::string & | FrameBufferName | ) | [pure virtual] |
Creates FrameBuffer with given name.
FrameBufferName | - name of our framebuffer. |
Implemented in gpucalc::GLGraphicCore.
virtual Texture* gpucalc::GraphicCore::create | ( | const std::string & | TextureName, | |
TextureUsage | Usage | |||
) | [pure virtual] |
Creates Texture with given name and type of usage.
TextureName | - name for our texture | |
Usage | - defines usage of texture: as simple storage of our data, or render target. |
Implemented in gpucalc::GLGraphicCore.
virtual void gpucalc::GraphicCore::destroy | ( | FrameBuffer * | fb | ) | [pure virtual] |
virtual void gpucalc::GraphicCore::destroy | ( | Texture * | texture | ) | [pure virtual] |
virtual void gpucalc::GraphicCore::draw | ( | float | TexCoordX, | |
float | TexCoordY | |||
) | [pure virtual] |
Draw quad with given texture coords.
TexCoordX | - X texture coordinate. | |
TexCoordY | - Y texture coordinate. |
Implemented in gpucalc::GLGraphicCore.
virtual FrameBuffer* gpucalc::GraphicCore::getActiveFrameBuffer | ( | ) | const [pure virtual] |
virtual Texture* gpucalc::GraphicCore::getActiveTexture | ( | ) | const [pure virtual] |
Implemented in gpucalc::GLGraphicCore.
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 }
virtual FrameBuffer* gpucalc::GraphicCore::getFrameBufferByName | ( | const std::string & | FrameBufferName | ) | const [pure virtual] |
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 Texture* gpucalc::GraphicCore::getTextureByName | ( | const std::string & | TextureName | ) | const [pure virtual] |
Finds and return previously created Texture.
If texture cannot be found, exception is thrown.
Implemented in gpucalc::GLGraphicCore.
virtual Vendor gpucalc::GraphicCore::getVendor | ( | ) | const [pure virtual] |
virtual bool gpucalc::GraphicCore::isAcceptSystem | ( | const ShaderSystem * | System | ) | const [pure virtual] |
Check for ShaderSystem acceptance.
We need correct type of ShaderSystem, because some shader systems cannot work with some graphic cores (DX core and GL system).
Implemented in gpucalc::GLGraphicCore.
virtual bool gpucalc::GraphicCore::isFrameBufferCreated | ( | const std::string & | FrameBufferName | ) | const [pure virtual] |
bool gpucalc::Object::isLocked | ( | ) | const [inline, inherited] |
virtual bool gpucalc::GraphicCore::isTextureCreated | ( | const std::string & | TextureName | ) | const [pure virtual] |
void gpucalc::Object::lock | ( | ) | [inline, protected, inherited] |
virtual int gpucalc::GraphicCore::maxFramebufferAttachmentPoints | ( | ) | const [pure virtual] |
virtual int gpucalc::GraphicCore::maxTextureSize | ( | ) | const [pure virtual] |
virtual void gpucalc::GraphicCore::setMatrixMode | ( | float | Width, | |
float | Height | |||
) | [pure virtual] |
Setting up model view matrices, setting up viewport for correct rendering quad.
Width | - width of rendering window. | |
Height | - height of rendering window. |
Implemented in gpucalc::GLGraphicCore.
virtual void gpucalc::GraphicCore::start | ( | int | argc, | |
char * | argv[] | |||
) | [pure virtual] |
Starts our GraphicCore.
This method initializes graphical libraries, sets up all extensions (OpenGL) and function pointers. Creates rendering window, and configure library for offscreen rendering.
Implemented in gpucalc::GLGraphicCore.
virtual void gpucalc::GraphicCore::stop | ( | ) | [pure virtual] |
Stops our GraphicCore.
This method deinitializes graphical libraries, deletes and frees resources (rendering window)
Implemented in gpucalc::GLGraphicCore.
virtual void gpucalc::GraphicCore::unbind | ( | FrameBuffer * | framebuffer | ) | [pure virtual] |
Implemented in gpucalc::GLGraphicCore.
virtual void gpucalc::GraphicCore::unbind | ( | Texture * | texture | ) | [pure virtual] |
Implemented in gpucalc::GLGraphicCore.
void gpucalc::Object::unlock | ( | ) | [inline, protected, inherited] |