gpucalc::GLGLSLUniform Class Reference

#include <gl_glsl_uniform.h>

Inheritance diagram for gpucalc::GLGLSLUniform:

Inheritance graph

List of all members.

Public Types

enum  UniformType {
  UT_NOT_UNIFORM = 0, UT_TEX_1, UT_TEX_2, UT_INT_1,
  UT_INT_2, UT_INT_3, UT_INT_4, UT_BOOL_1,
  UT_BOOL_2, UT_BOOL_3, UT_BOOL_4, UT_FLOAT_1,
  UT_FLOAT_2, UT_FLOAT_3, UT_FLOAT_4, UT_MAT_2X2,
  UT_MAT_3X3, UT_MAT_4X4
}

Public Member Functions

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.
TexturegetSampler () const
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
Uniform::UniformType getUniformType () const
 GLGLSLUniform (const std::string &UniformName)
void initialize ()
bool isInitialized () const
bool isLocked () const
 returns state of object.
bool isUploadedToGPU () const
void * pointer () const
void uploadToGPU ()

Protected Member Functions

void addSpecificParameter (const std::string &ParameterName, void *ParameterValue, size_t 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

bool mIsUploadedToGPU
void * mPointer
TexturemSampler
Uniform::UniformType mUniformType

Friends

class GLGLSLShaderSystem


Detailed Description

Definition at line 50 of file gl_glsl_uniform.h.


Member Enumeration Documentation

Enumerator:
UT_NOT_UNIFORM 
UT_TEX_1 
UT_TEX_2 
UT_INT_1 
UT_INT_2 
UT_INT_3 
UT_INT_4 
UT_BOOL_1 
UT_BOOL_2 
UT_BOOL_3 
UT_BOOL_4 
UT_FLOAT_1 
UT_FLOAT_2 
UT_FLOAT_3 
UT_FLOAT_4 
UT_MAT_2X2 
UT_MAT_3X3 
UT_MAT_4X4 

Definition at line 56 of file uniform.h.

00057    {
00058     UT_NOT_UNIFORM = 0,
00059 
00060     UT_TEX_1,
00061     UT_TEX_2,
00062 
00063     UT_INT_1,
00064     UT_INT_2,
00065     UT_INT_3,
00066     UT_INT_4,
00067 
00068     UT_BOOL_1,
00069     UT_BOOL_2,
00070     UT_BOOL_3,
00071     UT_BOOL_4,
00072 
00073     UT_FLOAT_1,
00074     UT_FLOAT_2,
00075     UT_FLOAT_3,
00076     UT_FLOAT_4,
00077 
00078     UT_MAT_2X2,
00079     UT_MAT_3X3,
00080     UT_MAT_4X4
00081    };


Constructor & Destructor Documentation

gpucalc::GLGLSLUniform::GLGLSLUniform ( const std::string &  UniformName  )  [inline]

Definition at line 60 of file gl_glsl_uniform.h.

00060                                                :
00061     Object(_GLGLSLUniformClassName, UniformName), Uniform(_GLGLSLUniformClassName, UniformName), mIsUploadedToGPU(false),
00062     mUniformType(UT_NOT_UNIFORM), mPointer(0), mSampler(0)
00063    {
00064    }


Member Function Documentation

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 size_t gpucalc::GPUResource::getActualLengthGPU (  )  const [inline, virtual, inherited]

Definition at line 105 of file gpu_resource.h.

00106    {
00107     return mActualLengthGPU;
00108    }

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]

Definition at line 99 of file gpu_resource.h.

00100    {
00101     return mComponentSize;
00102    }

virtual int gpucalc::GPUResource::getDimension (  )  const [inline, virtual, inherited]

Definition at line 87 of file gpu_resource.h.

00088    {
00089     return mDimension;
00090    }

virtual size_t gpucalc::GPUResource::getNumberOfComponents (  )  const [inline, virtual, inherited]

Definition at line 63 of file gpu_resource.h.

00064    {
00065     return mNumberOfComponents;
00066    }

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    }

Texture* gpucalc::GLGLSLUniform::getSampler (  )  const [inline, virtual]

Implements gpucalc::Uniform.

Definition at line 97 of file gl_glsl_uniform.h.

00098    {
00099     assert(mSampler && "GLGLSLUniform:\t returning uninitialized Sampler!!!");
00100     return mSampler;
00101    }

virtual int gpucalc::GPUResource::getSizeX (  )  const [inline, virtual, inherited]

Definition at line 69 of file gpu_resource.h.

00070    {
00071     return mSizeX;
00072    }

virtual int gpucalc::GPUResource::getSizeY (  )  const [inline, virtual, inherited]

Definition at line 75 of file gpu_resource.h.

00076    {
00077     return mSizeY;
00078    }

virtual int gpucalc::GPUResource::getSizeZ (  )  const [inline, virtual, inherited]

Definition at line 81 of file gpu_resource.h.

00082    {
00083     return mSizeZ;
00084    }

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 size_t gpucalc::GPUResource::getTypeSize (  )  const [inline, virtual, inherited]

Definition at line 93 of file gpu_resource.h.

00094    {
00095     return mTypeSize;
00096    }

Uniform::UniformType gpucalc::GLGLSLUniform::getUniformType (  )  const [inline, virtual]

Implements gpucalc::Uniform.

Definition at line 91 of file gl_glsl_uniform.h.

00092    {
00093     return mUniformType;
00094    }

void gpucalc::GLGLSLUniform::initialize (  )  [inline, virtual]

Implements gpucalc::GPUResource.

Definition at line 79 of file gl_glsl_uniform.h.

00080    {
00081     // does nothing
00082    }

bool gpucalc::GLGLSLUniform::isInitialized (  )  const [inline, virtual]

Implements gpucalc::GPUResource.

Definition at line 85 of file gl_glsl_uniform.h.

00086    {
00087     return true;
00088    }

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    }

bool gpucalc::GLGLSLUniform::isUploadedToGPU (  )  const [inline, virtual]

Implements gpucalc::GPUResource.

Definition at line 73 of file gl_glsl_uniform.h.

00074    {
00075     return mIsUploadedToGPU;
00076    }

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

Definition at line 265 of file object.h.

00266    {
00267     mIsLocked = true;
00268    }

void* gpucalc::GLGLSLUniform::pointer (  )  const [inline, virtual]

Implements gpucalc::Uniform.

Definition at line 104 of file gl_glsl_uniform.h.

00105    {
00106     assert(mPointer && "GLGLSLUniform:\t returning uninitialized pointer!!!");
00107     return mPointer;
00108    }

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

Definition at line 271 of file object.h.

00272    {
00273     mIsLocked = false;
00274    }

void gpucalc::GLGLSLUniform::uploadToGPU (  )  [inline, virtual]

Implements gpucalc::GPUResource.

Definition at line 67 of file gl_glsl_uniform.h.

00068    {
00069     mIsUploadedToGPU = true;
00070    }


Friends And Related Function Documentation

friend class GLGLSLShaderSystem [friend]

Definition at line 56 of file gl_glsl_uniform.h.


Member Data Documentation

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.

size_t gpucalc::GPUResource::mDimension [protected, inherited]

Definition at line 129 of file gpu_resource.h.

Definition at line 112 of file gl_glsl_uniform.h.

size_t gpucalc::GPUResource::mNumberOfComponents [protected, inherited]

Definition at line 125 of file gpu_resource.h.

void* gpucalc::GLGLSLUniform::mPointer [mutable, private]

Definition at line 118 of file gl_glsl_uniform.h.

Definition at line 121 of file gl_glsl_uniform.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.

Definition at line 115 of file gl_glsl_uniform.h.


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