2002-06-27 18:50:19 +08:00
|
|
|
#include <osg/Primitive>
|
|
|
|
|
|
|
|
using namespace osg;
|
|
|
|
|
2002-06-27 21:15:34 +08:00
|
|
|
void DrawArrays::draw() const
|
2002-06-27 18:50:19 +08:00
|
|
|
{
|
2002-06-27 21:15:34 +08:00
|
|
|
glDrawArrays(_mode,_first,_count);
|
|
|
|
}
|
|
|
|
|
|
|
|
void DrawArrays::applyPrimitiveOperation(Drawable::PrimitiveFunctor& functor)
|
|
|
|
{
|
|
|
|
functor.drawArrays(_mode,_first,_count);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void UByteDrawElements::draw() const
|
|
|
|
{
|
|
|
|
glDrawElements(_mode,size(),GL_UNSIGNED_BYTE,&front());
|
|
|
|
}
|
|
|
|
|
|
|
|
void UByteDrawElements::applyPrimitiveOperation(Drawable::PrimitiveFunctor& functor)
|
|
|
|
{
|
|
|
|
if (!empty()) functor.drawElements(_mode,size(),&front());
|
|
|
|
}
|
2002-06-27 18:50:19 +08:00
|
|
|
|
2002-06-27 21:15:34 +08:00
|
|
|
|
|
|
|
void UShortDrawElements::draw() const
|
|
|
|
{
|
|
|
|
glDrawElements(_mode,size(),GL_UNSIGNED_SHORT,&front());
|
|
|
|
}
|
|
|
|
|
|
|
|
void UShortDrawElements::applyPrimitiveOperation(Drawable::PrimitiveFunctor& functor)
|
2002-06-27 18:50:19 +08:00
|
|
|
{
|
2002-06-27 21:15:34 +08:00
|
|
|
if (!empty()) functor.drawElements(_mode,size(),&front());
|
2002-06-27 18:50:19 +08:00
|
|
|
}
|
|
|
|
|
2002-06-27 21:15:34 +08:00
|
|
|
|
|
|
|
|
|
|
|
void UIntDrawElements::draw() const
|
|
|
|
{
|
|
|
|
glDrawElements(_mode,size(),GL_UNSIGNED_INT,&front());
|
|
|
|
}
|
|
|
|
|
|
|
|
void UIntDrawElements::applyPrimitiveOperation(Drawable::PrimitiveFunctor& functor)
|
|
|
|
{
|
|
|
|
if (!empty()) functor.drawElements(_mode,size(),&front());
|
|
|
|
}
|