gpucalc::GraphicCore Class Reference

Abstract class representing graphical core. More...

#include <graphic_core.h>

Inheritance diagram for gpucalc::GraphicCore:

Inheritance graph

List of all members.

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 FrameBuffercreate (const std::string &FrameBufferName)=0
 Creates FrameBuffer with given name.
virtual Texturecreate (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 FrameBuffergetActiveFrameBuffer () const =0
 Returns active FrameBuffer.
virtual TexturegetActiveTexture () const =0
const std::string & getClassName () const
 Returns name of class of our object.
virtual FrameBuffergetFrameBufferByName (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 TexturegetTextureByName (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 ()


Detailed Description

Abstract class representing graphical core.

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().

Todo:
!!!!!мега важно, аж по русски Создать или pixelbuffer или directcopy методы для чтения результатов рендеринга, когда FrameBuffer не работает

Definition at line 83 of file graphic_core.h.


Constructor & Destructor Documentation

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]

Definition at line 98 of file graphic_core.h.

00099    {
00100    }


Member Function Documentation

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.

Parameters:
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.

Parameters:
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.

Parameters:
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]

Delete framebuffer and free memeory in GPU-side.

Implemented in gpucalc::GLGraphicCore.

virtual void gpucalc::GraphicCore::destroy ( Texture texture  )  [pure virtual]

Delete texture and free memory in GPU-side.

Implemented in gpucalc::GLGraphicCore.

virtual void gpucalc::GraphicCore::draw ( float  TexCoordX,
float  TexCoordY 
) [pure virtual]

Draw quad with given texture coords.

Parameters:
TexCoordX - X texture coordinate.
TexCoordY - Y texture coordinate.
We must set up coorect texture coordinate, because shader must know how to read data from texture samplers. Usually we use 1:1 correlation between texture coords and size of rendering window.

Implemented in gpucalc::GLGraphicCore.

virtual FrameBuffer* gpucalc::GraphicCore::getActiveFrameBuffer (  )  const [pure virtual]

Returns active FrameBuffer.

Implemented in gpucalc::GLGraphicCore.

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]

Finds and return previously created FrameBuffer.

Implemented in gpucalc::GLGraphicCore.

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.

Parameters:
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.
Todo:
Think for better realization.

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]

Returns vendor type.

Implemented in gpucalc::GLGraphicCore.

virtual void gpucalc::GraphicCore::initialize ( const Data data,
Texture texture 
) [pure virtual]

Reinitalizes previously created texture with new Data.

Implemented in gpucalc::GLGraphicCore.

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]

Check for existence.

Implemented in gpucalc::GLGraphicCore.

bool gpucalc::Object::isLocked (  )  const [inline, inherited]

returns state of object.

If object is locked then we cannot change some state of it, because object is used in computation. If object is unlocked then we can change some state of it, object is not in computation.

Definition at line 113 of file object.h.

00114    {
00115     return mIsLocked;
00116    }

virtual bool gpucalc::GraphicCore::isTextureCreated ( const std::string &  TextureName  )  const [pure virtual]

Check for existence.

Implemented in gpucalc::GLGraphicCore.

void gpucalc::Object::lock (  )  [inline, protected, inherited]

Definition at line 265 of file object.h.

00266    {
00267     mIsLocked = true;
00268    }

virtual int gpucalc::GraphicCore::maxFramebufferAttachmentPoints (  )  const [pure virtual]

Returns maximal number of attachment points.

Implemented in gpucalc::GLGraphicCore.

virtual int gpucalc::GraphicCore::maxTextureSize (  )  const [pure virtual]

Returns maximal size of texture.

Implemented in gpucalc::GLGraphicCore.

virtual void gpucalc::GraphicCore::setMatrixMode ( float  Width,
float  Height 
) [pure virtual]

Setting up model view matrices, setting up viewport for correct rendering quad.

Parameters:
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]

Definition at line 271 of file object.h.

00272    {
00273     mIsLocked = false;
00274    }


The documentation for this class was generated from the following file:

Generated on Thu Mar 5 22:36:44 2009 for gpucalc by  doxygen 1.5.6