Skip to content

Commit e6f7510

Browse files
Merge pull request #1247 from johnhaddon/glCurvesPoints
IECoreGL::CurvesPrimitive : Support (limited) drawing of points
2 parents f37d2e4 + 1635d23 commit e6f7510

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/IECoreGL/CurvesPrimitive.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,23 @@ void CurvesPrimitive::render( const State *currentState, IECore::TypeId style )
218218
bool linear, ribbons;
219219
renderMode( currentState, linear, ribbons );
220220

221+
if( style == DrawPoints::staticTypeId() )
222+
{
223+
if( linear && !ribbons )
224+
{
225+
glDrawArrays( GL_POINTS, 0, m_memberData->points->readable().size() );
226+
}
227+
else
228+
{
229+
// We can't implement point drawing here because our `shaderSetup()`
230+
// override will have created a geometry shader unsuitable for
231+
// rendering points.
232+
/// \todo Redesign the Primitive classes to make this possible - see
233+
/// comments on `Primitive::shaderSetup()`.
234+
}
235+
return;
236+
}
237+
221238
if( !ribbons && style != DrawWireframe::staticTypeId() && currentState->get<DrawWireframe>()->value() )
222239
{
223240
// If we're going to be drawing wireframe, then don't draw anything else

0 commit comments

Comments
 (0)