Commit 29323d02 authored by schurade's avatar schurade
Browse files

[CHANGE] use osg::state for vertex arrays, still crashes for some unknown reason

parent 2e13c3e7
......@@ -102,30 +102,31 @@ bool WTubeDrawable::getColoringMode() const
return m_globalColoring;
}
void WTubeDrawable::drawFibers( osg::RenderInfo& /* renderInfo */ ) const //NOLINT
void WTubeDrawable::drawFibers( osg::RenderInfo& renderInfo ) const //NOLINT
{
boost::shared_ptr< std::vector< size_t > > startIndexes = m_dataset->getLineStartIndexes();
boost::shared_ptr< std::vector< size_t > > pointsPerLine = m_dataset->getLineLengths();
boost::shared_ptr< std::vector< float > > verts = m_dataset->getVertices();
boost::shared_ptr< std::vector< float > > colors = ( m_globalColoring ? m_dataset->getGlobalColors() : m_dataset->getLocalColors() );
boost::shared_ptr< std::vector< bool > > active = WKernel::getRunningKernel()->getRoiManager()->getBitField();
#if 0
glEnableClientState( GL_VERTEX_ARRAY );
glEnableClientState( GL_COLOR_ARRAY );
osg::State& state = *renderInfo.getState();
glVertexPointer( 3, GL_FLOAT, 0, &(*verts)[0] ); //NOLINT
glColorPointer( 3, GL_FLOAT, 0, &(*colors)[0] ); //NOLINT
state.setVertexPointer( 3, GL_FLOAT ,0, &(*verts)[0] );
state.setColorPointer( 3 , GL_FLOAT ,0 , &(*colors)[0] );
for ( size_t i = 0; i < active->size(); ++i )
//for ( size_t i = 0; i < active->size(); ++i )
for ( size_t i = 0; i < 10000; ++i )
{
if ( (*active)[i] )
{
glDrawArrays( GL_LINE_STRIP, (*startIndexes)[i] * 3, (*pointsPerLine)[i] );
glDrawArrays( GL_LINE_STRIP, (*startIndexes)[i], (*pointsPerLine)[i] );
}
}
glDisableClientState( GL_VERTEX_ARRAY );
glDisableClientState( GL_COLOR_ARRAY );
state.disableVertexPointer();
state.disableColorPointer();
#else
for ( size_t i = 0; i < active->size(); ++i )
{
......
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