MCPcopy Create free account
hub / github.com/ImageEngine/cortex / renderInstances

Method renderInstances

src/IECoreGL/QuadPrimitive.cpp:100–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100void QuadPrimitive::renderInstances( size_t numInstances ) const
101{
102 if( !m_vertIdsBuffer )
103 {
104 // we don't build the actual buffer until now, because in the constructor we're not guaranteed
105 // a valid GL context.
106 CachedConverterPtr cachedConverter = CachedConverter::defaultCachedConverter();
107 m_vertIdsBuffer = IECore::runTimeCast<const Buffer>( cachedConverter->convert( m_vertIds.get() ) );
108 }
109
110 Buffer::ScopedBinding indexBinding( *m_vertIdsBuffer, GL_ELEMENT_ARRAY_BUFFER );
111 glDrawElementsInstancedARB( GL_TRIANGLES, m_vertIds->readable().size(), GL_UNSIGNED_INT, nullptr, numInstances );
112}
113
114Imath::Box3f QuadPrimitive::bound() const
115{

Callers

nothing calls this directly

Calls 4

readableMethod · 0.80
convertMethod · 0.45
getMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected