------------------------------------------------------------- Description: Implements Tr2DeviceResource method. Creates vertex buffer and vertex declaration. -------------------------------------------------------------
| 76 | // and vertex declaration. |
| 77 | // ------------------------------------------------------------- |
| 78 | bool Tr2CurveLineSet::OnPrepareResources() |
| 79 | { |
| 80 | // create vertex decl |
| 81 | if( m_vertexDeclHandle == Tr2EffectStateManager::UNINITIALIZED_DECLARATION ) |
| 82 | { |
| 83 | static Tr2VertexDefinition s_curveLineDataVertexDecl; |
| 84 | if( s_curveLineDataVertexDecl.empty() ) |
| 85 | { |
| 86 | Tr2VertexDefinition& tvd = s_curveLineDataVertexDecl; |
| 87 | |
| 88 | tvd.Add( tvd.FLOAT32_3, tvd.POSITION ); |
| 89 | |
| 90 | tvd.Add( tvd.FLOAT32_4, tvd.TEXCOORD, 0 ); |
| 91 | tvd.Add( tvd.FLOAT32_4, tvd.TEXCOORD, 1 ); |
| 92 | tvd.Add( tvd.FLOAT32_3, tvd.TEXCOORD, 2 ); |
| 93 | tvd.Add( tvd.FLOAT32_3, tvd.TEXCOORD, 3 ); |
| 94 | |
| 95 | tvd.Add( tvd.UBYTE_4_NORM, tvd.COLOR, 0 ); |
| 96 | tvd.Add( tvd.UBYTE_4_NORM, tvd.COLOR, 1 ); |
| 97 | tvd.Add( tvd.UBYTE_4_NORM, tvd.COLOR, 2 ); |
| 98 | } |
| 99 | |
| 100 | m_vertexDeclHandle = Tr2EffectStateManager::GetVertexDeclarationHandle( s_curveLineDataVertexDecl ); |
| 101 | if( m_vertexDeclHandle == Tr2EffectStateManager::UNINITIALIZED_DECLARATION ) |
| 102 | { |
| 103 | return false; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | // always fill it (this will also create a vertexbuffer) |
| 108 | return FillVertexBuffer(); |
| 109 | } |
| 110 | |
| 111 | // ------------------------------------------------------------- |
| 112 | // Description: |
nothing calls this directly
no test coverage detected