| 622 | } |
| 623 | |
| 624 | GFXVertexDecl* GFXGLDevice::allocVertexDecl( const GFXVertexFormat *vertexFormat ) |
| 625 | { |
| 626 | PROFILE_SCOPE(GFXGLDevice_allocVertexDecl); |
| 627 | typedef Map<void*, GFXGLVertexDecl> GFXGLVertexDeclMap; |
| 628 | static GFXGLVertexDeclMap declMap; |
| 629 | GFXGLVertexDeclMap::Iterator itr = declMap.find( (void*)vertexFormat->getDescription().c_str() ); // description string are interned, safe to use c_str() |
| 630 | if(itr != declMap.end()) |
| 631 | return &itr->value; |
| 632 | |
| 633 | GFXGLVertexDecl &decl = declMap[(void*)vertexFormat->getDescription().c_str()]; |
| 634 | decl.init(vertexFormat); |
| 635 | return &decl; |
| 636 | } |
| 637 | |
| 638 | void GFXGLDevice::setVertexDecl( const GFXVertexDecl *decl ) |
| 639 | { |
no test coverage detected