MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / _drawWireTriangle

Method _drawWireTriangle

Engine/source/gfx/gfxDrawUtil.cpp:736–766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

734}
735
736void GFXDrawUtil::_drawWireTriangle( const GFXStateBlockDesc &desc, const Point3F &p0, const Point3F &p1, const Point3F &p2, const ColorI &color, const MatrixF *xfm )
737{
738 GFXVertexBufferHandle<GFXVertexPCT> verts(mDevice, 4, GFXBufferTypeVolatile);
739 verts.lock();
740 // Set up the line strip
741 verts[0].point = p0;
742 verts[0].color = color;
743 verts[1].point = p1;
744 verts[1].color = color;
745 verts[2].point = p2;
746 verts[2].color = color;
747 verts[3].point = p0;
748 verts[3].color = color;
749
750 // Apply xfm if we were passed one.
751 if ( xfm != NULL )
752 {
753 for ( U32 i = 0; i < 4; i++ )
754 xfm->mulP( verts[i].point );
755 }
756
757 verts.unlock();
758
759 GFXStateBlockRef sb = mDevice->createStateBlock( desc );
760 mDevice->setStateBlock( sb );
761
762 mDevice->setVertexBuffer( verts );
763 mDevice->setupGenericShaders();
764
765 mDevice->drawPrimitive( GFXLineStrip, 0, 3 );
766}
767
768void GFXDrawUtil::_drawSolidTriangle( const GFXStateBlockDesc &desc, const Point3F &p0, const Point3F &p1, const Point3F &p2, const ColorI &color, const MatrixF *xfm )
769{

Callers

nothing calls this directly

Calls 8

mulPMethod · 0.80
createStateBlockMethod · 0.80
setVertexBufferMethod · 0.80
lockMethod · 0.45
unlockMethod · 0.45
setStateBlockMethod · 0.45
setupGenericShadersMethod · 0.45
drawPrimitiveMethod · 0.45

Tested by

no test coverage detected