Commit 4cf80dd6 authored by Robert Menzel's avatar Robert Menzel

updated smartpointer macro

parent eb8a5c10
......@@ -45,7 +45,7 @@ private:
};
ACGL_SHARED_TYPEDEF(Animation)
ACGL_SMARTPOINTER_TYPEDEFS(Animation)
typedef std::list<SharedAnimation> AnimationList;
typedef std::queue<SharedAnimation> AnimationQueue;
......@@ -164,7 +164,7 @@ private:
long mDuration;
};
ACGL_SHARED_TYPEDEF(AnimationWait)
ACGL_SMARTPOINTER_TYPEDEFS(AnimationWait)
// AnimationSequential *************************************************************************************
......@@ -187,7 +187,7 @@ private:
AnimationList mAnimations;
};
ACGL_SHARED_TYPEDEF(AnimationSequential)
ACGL_SMARTPOINTER_TYPEDEFS(AnimationSequential)
// AnimationParallel *************************************************************************************
......@@ -210,7 +210,7 @@ private:
uint_t mRunningAnimations;
};
ACGL_SHARED_TYPEDEF(AnimationParallel)
ACGL_SMARTPOINTER_TYPEDEFS(AnimationParallel)
// AnimationVariable *************************************************************************************
......@@ -306,13 +306,13 @@ private:
};
typedef AnimationVariable<float, LinearInterpolatorFloat > AnimationFloatLinear;
ACGL_SHARED_TYPEDEF(AnimationFloatLinear)
ACGL_SMARTPOINTER_TYPEDEFS(AnimationFloatLinear)
typedef AnimationVariable<glm::vec2, LinearInterpolatorVec2 > AnimationVec2Linear;
ACGL_SHARED_TYPEDEF(AnimationVec2Linear)
ACGL_SMARTPOINTER_TYPEDEFS(AnimationVec2Linear)
typedef AnimationVariable<glm::vec3, LinearInterpolatorVec3 > AnimationVec3Linear;
ACGL_SHARED_TYPEDEF(AnimationVec3Linear)
ACGL_SMARTPOINTER_TYPEDEFS(AnimationVec3Linear)
template <class T, class SpeedInterpolator>
class AnimationSpeed : public Animation{
......
......@@ -24,7 +24,7 @@ public:
virtual float value(const float _progress) = 0;
};
ACGL_SHARED_TYPEDEF(EaseFunction)
ACGL_SMARTPOINTER_TYPEDEFS(EaseFunction)
/*
float Linear(float progress, ease_function_parameter& parameter);
......
......@@ -26,7 +26,7 @@ public:
virtual void blend(const void* value, const float progress) = 0;
};
ACGL_SHARED_TYPEDEF(BlendInterpolator)
ACGL_SMARTPOINTER_TYPEDEFS(BlendInterpolator)
struct interpolator_blend_t
{
......
......@@ -12,11 +12,14 @@ private:\
Class(const Class& ){ }\
void operator=(Class& ){ }
#define ACGL_SHARED_TYPEDEF(Class) \
// creates typedefs for a given class for each smartpointer type
#define ACGL_SMARTPOINTER_TYPEDEFS(Class) \
typedef ptr::shared_ptr<Class> Shared ## Class; \
typedef ptr::shared_ptr<const Class> ConstShared ## Class; \
typedef ptr::weak_ptr<Class> Weak ## Class; \
typedef ptr::weak_ptr<const Class> ConstWeak ## Class;
typedef ptr::weak_ptr<const Class> ConstWeak ## Class; \
typedef ptr::unique_ptr<Class> Unique ## Class; \
typedef ptr::unique_ptr<const Class> ConstUnique ## Class;
#endif // MACROS_HH
......@@ -40,7 +40,7 @@ public:
virtual bool update(SharedTextureData& _texture);
};
ACGL_SHARED_TYPEDEF(TextureDataControlFile)
ACGL_SMARTPOINTER_TYPEDEFS(TextureDataControlFile)
} // OpenGL
} // ACGL
......
......@@ -51,7 +51,7 @@ private:
static int_t sTypeID;
};
ACGL_SHARED_TYPEDEF(TextureDataControlFileJPG)
ACGL_SMARTPOINTER_TYPEDEFS(TextureDataControlFileJPG)
} // OpenGL
} // ACGL
......
......@@ -51,7 +51,7 @@ private:
static int_t sTypeID;
};
ACGL_SHARED_TYPEDEF(TextureDataControlFilePNG)
ACGL_SMARTPOINTER_TYPEDEFS(TextureDataControlFilePNG)
} // OpenGL
} // ACGL
......
......@@ -67,7 +67,7 @@ private:
GLenum type;
};
ACGL_SHARED_TYPEDEF(TextureData)
ACGL_SMARTPOINTER_TYPEDEFS(TextureData)
} // OpenGL
} // ACGL
......
......@@ -170,7 +170,7 @@ protected:
AttributeVec mAttributes;
};
ACGL_SHARED_TYPEDEF(ArrayBuffer)
ACGL_SMARTPOINTER_TYPEDEFS(ArrayBuffer)
} // OpenGL
......
......@@ -299,7 +299,7 @@ protected:
GLenum mTarget;
};
ACGL_SHARED_TYPEDEF(Buffer)
ACGL_SMARTPOINTER_TYPEDEFS(Buffer)
} // OpenGL
} // ACGL
......
......@@ -77,7 +77,7 @@ protected:
GLenum mType;
};
ACGL_SHARED_TYPEDEF(ElementArrayBuffer)
ACGL_SMARTPOINTER_TYPEDEFS(ElementArrayBuffer)
} // OpenGL
......
......@@ -200,7 +200,7 @@ protected:
Attachment mDepthAttachment; // depth and stencil are combined
};
ACGL_SHARED_TYPEDEF(FrameBufferObject)
ACGL_SMARTPOINTER_TYPEDEFS(FrameBufferObject)
} // OpenGL
} // ACGL
......
......@@ -81,7 +81,7 @@ protected:
LocationMap mMappings;
};
ACGL_SHARED_TYPEDEF(LocationMappings)
ACGL_SMARTPOINTER_TYPEDEFS(LocationMappings)
} // OpenGL
} // ACGL
......
......@@ -85,7 +85,7 @@ protected:
GLuint mObjectName;
GLenum mTarget;
};
ACGL_SHARED_TYPEDEF(AsynchronousQuery)
ACGL_SMARTPOINTER_TYPEDEFS(AsynchronousQuery)
/*
* Occlusion queries count the fragments that pass the z-test.
......@@ -118,7 +118,7 @@ public:
return getResult();
}
};
ACGL_SHARED_TYPEDEF(OcclusionQuery)
ACGL_SMARTPOINTER_TYPEDEFS(OcclusionQuery)
#if (ACGL_OPENGL_VERSION >= 33)
......@@ -148,7 +148,7 @@ public:
return getResult64();
}
};
ACGL_SHARED_TYPEDEF(TimerQuery)
ACGL_SMARTPOINTER_TYPEDEFS(TimerQuery)
#endif // OpenGL >= 3.3
#if (ACGL_OPENGL_VERSION >= 31)
......@@ -176,7 +176,7 @@ public:
mTarget = _queryType;
}
};
ACGL_SHARED_TYPEDEF(PrimitiveQuery)
ACGL_SMARTPOINTER_TYPEDEFS(PrimitiveQuery)
#endif // OpenGL >= 3.1
} // OpenGL
......
......@@ -110,7 +110,7 @@ protected:
GLsizei mHeight;
};
ACGL_SHARED_TYPEDEF(RenderBuffer)
ACGL_SMARTPOINTER_TYPEDEFS(RenderBuffer)
} // OpenGL
} // ACGL
......
......@@ -112,7 +112,7 @@ protected:
ConstSharedViewport mpViewport;
};
ACGL_SHARED_TYPEDEF(RenderObject)
ACGL_SMARTPOINTER_TYPEDEFS(RenderObject)
}
}
......
......@@ -51,7 +51,8 @@ public:
// ===================================================================================================== \/
// ============================================================================================ WRAPPERS \/
// ===================================================================================================== \/
inline void bind(GLuint _textureUnit) const
//! _textureUnit is in the range 0..n (not GL_TEXTURE0..GL_TEXTUREn)
inline void bind(GLuint _textureUnit) const
{
glBindSampler( _textureUnit, mObjectName ); // yes, no adding of GL_TEXTURE0 !
openGLRareError();
......@@ -65,7 +66,7 @@ private:
GLuint mObjectName;
};
ACGL_SHARED_TYPEDEF(Sampler)
ACGL_SMARTPOINTER_TYPEDEFS(Sampler)
#endif // OpenGL >= 3.3
} // OpenGL
......
......@@ -73,7 +73,7 @@ protected:
GLenum mType;
};
ACGL_SHARED_TYPEDEF(Shader)
ACGL_SMARTPOINTER_TYPEDEFS(Shader)
} // OpenGL
} // ACGL
......
......@@ -314,7 +314,7 @@ protected:
ConstSharedShaderVec mShaders;
};
ACGL_SHARED_TYPEDEF(ShaderProgram)
ACGL_SMARTPOINTER_TYPEDEFS(ShaderProgram)
} // OpenGL
} // ACGL
......
......@@ -114,7 +114,7 @@ protected:
UniformTextureAttachmentVec mUniformTextureAttachments;
};
ACGL_SHARED_TYPEDEF(ShaderProgramObject)
ACGL_SMARTPOINTER_TYPEDEFS(ShaderProgramObject)
} // OpenGL
} // ACGL
......
......@@ -443,7 +443,7 @@ private:
GLenum mWrapR;
};
ACGL_SHARED_TYPEDEF(Texture)
ACGL_SMARTPOINTER_TYPEDEFS(Texture)
} // OpenGL
......
......@@ -37,7 +37,7 @@ public:
virtual void apply(GLint) const = 0;
};
ACGL_SHARED_TYPEDEF(Uniform)
ACGL_SMARTPOINTER_TYPEDEFS(Uniform)
// ================================================================================================= \/
// ===================================================================================== C-SIDE DATA \/
......@@ -88,7 +88,7 @@ public:
void apply(GLint _location) const { glUniform1i(_location, mValue); }
};
ACGL_SHARED_TYPEDEF(Uniform1i)
ACGL_SMARTPOINTER_TYPEDEFS(Uniform1i)
//=========================
......@@ -100,7 +100,7 @@ public:
void apply(GLint _location) const { glUniform1f(_location, mValue); }
};
ACGL_SHARED_TYPEDEF(Uniform1f)
ACGL_SMARTPOINTER_TYPEDEFS(Uniform1f)
//=========================
......@@ -112,7 +112,7 @@ public:
void apply(GLint _location) const { glUniform2fv(_location, 1, glm::value_ptr(mValue)); }
};
ACGL_SHARED_TYPEDEF(Uniform2f)
ACGL_SMARTPOINTER_TYPEDEFS(Uniform2f)
//=========================
......@@ -124,7 +124,7 @@ public:
void apply(GLint _location) const { glUniform3fv(_location, 1, glm::value_ptr(mValue)); }
};
ACGL_SHARED_TYPEDEF(Uniform3f)
ACGL_SMARTPOINTER_TYPEDEFS(Uniform3f)
//=========================
......@@ -136,7 +136,7 @@ public:
void apply(GLint _location) const { glUniform4fv(_location, 1, glm::value_ptr(mValue)); }
};
ACGL_SHARED_TYPEDEF(Uniform4f)
ACGL_SMARTPOINTER_TYPEDEFS(Uniform4f)
//=========================
......@@ -148,7 +148,7 @@ public:
void apply(GLint _location) const { glUniformMatrix2fv(_location, 1, GL_FALSE, glm::value_ptr(mValue)); }
};
ACGL_SHARED_TYPEDEF(UniformMatrix2f)
ACGL_SMARTPOINTER_TYPEDEFS(UniformMatrix2f)
//=========================
......@@ -160,7 +160,7 @@ public:
void apply(GLint _location) const { glUniformMatrix3fv(_location, 1, GL_FALSE, glm::value_ptr(mValue)); }
};
ACGL_SHARED_TYPEDEF(UniformMatrix3f)
ACGL_SMARTPOINTER_TYPEDEFS(UniformMatrix3f)
//=========================
......@@ -172,7 +172,7 @@ public:
void apply(GLint _location) const { glUniformMatrix4fv(_location, 1, GL_FALSE, glm::value_ptr(mValue)); }
};
ACGL_SHARED_TYPEDEF(UniformMatrix4f)
ACGL_SMARTPOINTER_TYPEDEFS(UniformMatrix4f)
//=========================
......@@ -184,7 +184,7 @@ public:
void apply(GLint _location, GLenum _unit) const { glUniform1i(_location, _unit); mValue->bind(_unit); }
};
ACGL_SHARED_TYPEDEF(UniformTexture)
ACGL_SMARTPOINTER_TYPEDEFS(UniformTexture)
} // OpenGL
} // ACGL
......
......@@ -398,7 +398,7 @@ private:
GLint mPreviousVAOName; // the VAO that was bound before the last enable() call
};
ACGL_SHARED_TYPEDEF(VertexArrayObject)
ACGL_SMARTPOINTER_TYPEDEFS(VertexArrayObject)
} // OpenGL
} // ACGL
......
......@@ -163,7 +163,7 @@ protected:
AttributeVec mAttributes;
};
ACGL_SHARED_TYPEDEF(VertexBufferObject)
ACGL_SMARTPOINTER_TYPEDEFS(VertexBufferObject)
} // OpenGL
} // ACGL
......
......@@ -78,7 +78,7 @@ protected:
GLsizei mHeight;
};
ACGL_SHARED_TYPEDEF(Viewport)
ACGL_SMARTPOINTER_TYPEDEFS(Viewport)
} // OpenGL
} // ACGL
......
......@@ -24,7 +24,7 @@ class FileManager : public Base::Singleton< FileManager<RESOURCE> >
public:
typedef ptr::shared_ptr< FileController<RESOURCE> > SharedController;
ACGL_SHARED_TYPEDEF(RESOURCE)
ACGL_SMARTPOINTER_TYPEDEFS(RESOURCE)
struct Resource
{
SharedController controller;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment