vcglib/wrap/glw/geometryshader.h

159 lines
3.7 KiB
C
Raw Normal View History

2012-04-30 20:23:53 +02:00
#ifndef GLW_GEOMETRYSHADER_H
#define GLW_GEOMETRYSHADER_H
#include "./shader.h"
namespace glw
{
class GeometryShaderArguments : public ShaderArguments
{
public:
typedef ShaderArguments BaseType;
2012-04-30 20:23:53 +02:00
typedef GeometryShaderArguments ThisType;
GeometryShaderArguments(void)
: BaseType()
2012-04-30 20:23:53 +02:00
{
;
2012-04-30 20:23:53 +02:00
}
void clear(void)
{
BaseType::clear();
}
};
class GeometryShader : public Shader
{
friend class Context;
public:
typedef Shader BaseType;
typedef GeometryShader ThisType;
virtual Type type(void) const
{
return GeometryShaderType;
}
protected:
GeometryShader(Context * ctx)
: BaseType(ctx)
{
;
}
virtual GLenum shaderType(void) const
{
return GL_GEOMETRY_SHADER;
}
bool create(const GeometryShaderArguments & args)
{
return BaseType::create(args);
}
};
namespace detail { template <> struct BaseOf <GeometryShader> { typedef Shader Type; }; };
typedef detail::ObjectSharedPointerTraits <GeometryShader> ::Type GeometryShaderPtr;
class SafeGeometryShader : public SafeShader
2012-04-30 20:23:53 +02:00
{
friend class Context;
friend class BoundGeometryShader;
2012-04-30 20:23:53 +02:00
public:
typedef SafeShader BaseType;
2012-04-30 20:23:53 +02:00
typedef SafeGeometryShader ThisType;
protected:
SafeGeometryShader(const GeometryShaderPtr & geometryShader)
: BaseType(geometryShader)
{
;
}
const GeometryShaderPtr & object(void) const
{
return static_cast<const GeometryShaderPtr &>(BaseType::object());
}
GeometryShaderPtr & object(void)
{
return static_cast<GeometryShaderPtr &>(BaseType::object());
}
};
namespace detail { template <> struct BaseOf <SafeGeometryShader> { typedef SafeShader Type; }; };
namespace detail { template <> struct ObjectBase <SafeGeometryShader> { typedef GeometryShader Type; }; };
namespace detail { template <> struct ObjectSafe <GeometryShader > { typedef SafeGeometryShader Type; }; };
typedef detail::ObjectSharedPointerTraits <SafeGeometryShader> ::Type GeometryShaderHandle;
class GeometryShaderBindingParams : public ShaderBindingParams
{
public:
typedef ShaderBindingParams BaseType;
typedef GeometryShaderBindingParams ThisType;
GeometryShaderBindingParams(void)
: BaseType(GL_GEOMETRY_SHADER, 0)
2012-04-30 20:23:53 +02:00
{
;
}
};
class BoundGeometryShader : public BoundShader
2012-04-30 20:23:53 +02:00
{
friend class Context;
public:
typedef BoundShader BaseType;
typedef BoundGeometryShader ThisType;
2012-04-30 20:23:53 +02:00
const GeometryShaderHandle & handle(void) const
2012-04-30 20:23:53 +02:00
{
return static_cast<const GeometryShaderHandle &>(BaseType::handle());
}
GeometryShaderHandle & handle(void)
{
return static_cast<GeometryShaderHandle &>(BaseType::handle());
2012-04-30 20:23:53 +02:00
}
protected:
BoundGeometryShader(const GeometryShaderHandle & handle, const ShaderBindingParams & params)
: BaseType(handle, params)
2012-04-30 20:23:53 +02:00
{
;
}
const GeometryShaderPtr & object(void) const
2012-04-30 20:23:53 +02:00
{
return this->handle()->object();
2012-04-30 20:23:53 +02:00
}
GeometryShaderPtr & object(void)
2012-04-30 20:23:53 +02:00
{
return this->handle()->object();
2012-04-30 20:23:53 +02:00
}
};
namespace detail { template <> struct ParamsOf <BoundGeometryShader> { typedef GeometryShaderBindingParams Type; }; };
namespace detail { template <> struct BaseOf <BoundGeometryShader> { typedef BoundShader Type; }; };
namespace detail { template <> struct ObjectBase <BoundGeometryShader> { typedef GeometryShader Type; }; };
namespace detail { template <> struct ObjectBound <GeometryShader > { typedef BoundGeometryShader Type; }; };
typedef detail::ObjectSharedPointerTraits <BoundGeometryShader> ::Type BoundGeometryShaderHandle;
2012-04-30 20:23:53 +02:00
};
2012-04-30 20:23:53 +02:00
#endif // GLW_GEOMETRYSHADER_H