#include <texture.h>
Public Member Functions | |
void | bind () |
Bind our object. | |
virtual size_t | getActualLengthGPU () const |
const std::string & | getClassName () const |
Returns name of class of our object. | |
virtual size_t | getComponentSize () const |
virtual int | getDimension () const |
virtual size_t | getNumberOfComponents () const |
const std::string & | getObjectName () const |
Returns name of our object. | |
virtual int | getSizeX () const |
virtual int | getSizeY () const |
virtual int | getSizeZ () const |
void | getSpecificParameter (const std::string &ParameterName, void *ParameterValue) |
Method for obtaining some specific parameters, such as texture specific params, and so on. | |
virtual size_t | getTypeSize () const |
virtual void | initialize ()=0 |
bool | isActive () const |
virtual bool | isInitialized () const =0 |
bool | isLocked () const |
returns state of object. | |
virtual bool | isRenderTexture () const =0 |
Indicates that this texture is a render target. | |
virtual bool | isUploadedToGPU () const =0 |
void | reInitialize (const Data &data) |
Texture (const std::string &TextureClassName, const std::string &TextureName, TextureUsage, GraphicCore *graphiccore) | |
void | unbind () |
Unbind our object. | |
virtual void | uploadToGPU ()=0 |
virtual | ~Texture () |
Protected Member Functions | |
void | addSpecificParameter (const std::string &ParameterName, void *ParameterValue, size_t Size) |
void | addSpecificParameter (const std::string &ParameterName, void *ParameterValue, unsigned int Size) |
void | lock () |
void | unlock () |
Protected Attributes | |
size_t | mActualLengthGPU |
size_t | mComponentSize |
size_t | mDimension |
size_t | mNumberOfComponents |
size_t | mSizeX |
size_t | mSizeY |
size_t | mSizeZ |
size_t | mTypeSize |
Private Attributes | |
GraphicCore * | mDefaultGraphicCore |
When data transferred from CPU side to GPU side it must be presented as textures, because DirectX and OpenGL work with them as with textures. So we transform our data to correspondent format and give it to graphical API.
Example of data which cant be rectangle: +--------------+ |**************| |**************| |******** | +--------------+
Definition at line 70 of file texture.h.
gpucalc::Texture::Texture | ( | const std::string & | TextureClassName, | |
const std::string & | TextureName, | |||
TextureUsage | , | |||
GraphicCore * | graphiccore | |||
) | [inline] |
Definition at line 77 of file texture.h.
00077 : 00078 Object(TextureClassName, TextureName), Bindable(TextureClassName, TextureName), GPUResource(TextureClassName, TextureName), 00079 mDefaultGraphicCore(graphiccore) 00080 { 00081 }
virtual gpucalc::Texture::~Texture | ( | ) | [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 }
void gpucalc::Texture::addSpecificParameter | ( | const std::string & | ParameterName, | |
void * | ParameterValue, | |||
unsigned int | Size | |||
) | [inline, protected] |
Definition at line 120 of file texture.h.
00121 { 00122 Bindable::addSpecificParameter(ParameterName, ParameterValue, Size); 00123 }
void gpucalc::Texture::bind | ( | ) | [inline, virtual] |
Bind our object.
For example, set in some active state (Texture, Shader and so on)
Implements gpucalc::Bindable.
Definition at line 94 of file texture.h.
00095 { 00096 mDefaultGraphicCore->bind(this); 00097 }
virtual size_t gpucalc::GPUResource::getActualLengthGPU | ( | ) | const [inline, virtual, inherited] |
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 size_t gpucalc::GPUResource::getComponentSize | ( | ) | const [inline, virtual, inherited] |
virtual int gpucalc::GPUResource::getDimension | ( | ) | const [inline, virtual, inherited] |
virtual size_t gpucalc::GPUResource::getNumberOfComponents | ( | ) | const [inline, virtual, inherited] |
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 }
virtual int gpucalc::GPUResource::getSizeX | ( | ) | const [inline, virtual, inherited] |
virtual int gpucalc::GPUResource::getSizeY | ( | ) | const [inline, virtual, inherited] |
virtual int gpucalc::GPUResource::getSizeZ | ( | ) | const [inline, virtual, inherited] |
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 size_t gpucalc::GPUResource::getTypeSize | ( | ) | const [inline, virtual, inherited] |
virtual void gpucalc::GPUResource::initialize | ( | ) | [pure virtual, inherited] |
Implemented in gpucalc::GLCgUniform, gpucalc::GLGLSLUniform, and gpucalc::GLTexture.
bool gpucalc::Texture::isActive | ( | ) | const [inline, virtual] |
Implements gpucalc::Bindable.
Definition at line 106 of file texture.h.
00107 { 00108 return (this == mDefaultGraphicCore->getActiveTexture()); 00109 }
virtual bool gpucalc::GPUResource::isInitialized | ( | ) | const [pure virtual, inherited] |
Implemented in gpucalc::GLCgUniform, gpucalc::GLGLSLUniform, and gpucalc::GLTexture.
bool gpucalc::Object::isLocked | ( | ) | const [inline, inherited] |
virtual bool gpucalc::Texture::isRenderTexture | ( | ) | const [pure virtual] |
virtual bool gpucalc::GPUResource::isUploadedToGPU | ( | ) | const [pure virtual, inherited] |
Implemented in gpucalc::GLCgUniform, gpucalc::GLGLSLUniform, and gpucalc::GLTexture.
void gpucalc::Object::lock | ( | ) | [inline, protected, inherited] |
void gpucalc::Texture::reInitialize | ( | const Data & | data | ) | [inline] |
Definition at line 112 of file texture.h.
00113 { 00114 mDefaultGraphicCore->initialize(data, *this); 00115 }
void gpucalc::Texture::unbind | ( | ) | [inline, virtual] |
Unbind our object.
For example, set in some inactive state (Texture, Shader and so on)
Implements gpucalc::Bindable.
Definition at line 100 of file texture.h.
00101 { 00102 mDefaultGraphicCore->unbind(this); 00103 }
void gpucalc::Object::unlock | ( | ) | [inline, protected, inherited] |
virtual void gpucalc::GPUResource::uploadToGPU | ( | ) | [pure virtual, inherited] |
Implemented in gpucalc::GLCgUniform, gpucalc::GLGLSLUniform, and gpucalc::GLTexture.
size_t gpucalc::GPUResource::mActualLengthGPU [protected, inherited] |
Definition at line 132 of file gpu_resource.h.
size_t gpucalc::GPUResource::mComponentSize [protected, inherited] |
Definition at line 131 of file gpu_resource.h.
GraphicCore* gpucalc::Texture::mDefaultGraphicCore [private] |
size_t gpucalc::GPUResource::mDimension [protected, inherited] |
Definition at line 129 of file gpu_resource.h.
size_t gpucalc::GPUResource::mNumberOfComponents [protected, inherited] |
Definition at line 125 of file gpu_resource.h.
size_t gpucalc::GPUResource::mSizeX [protected, inherited] |
Definition at line 126 of file gpu_resource.h.
size_t gpucalc::GPUResource::mSizeY [protected, inherited] |
Definition at line 127 of file gpu_resource.h.
size_t gpucalc::GPUResource::mSizeZ [protected, inherited] |
Definition at line 128 of file gpu_resource.h.
size_t gpucalc::GPUResource::mTypeSize [protected, inherited] |
Definition at line 130 of file gpu_resource.h.