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

Method _drawSolidTriangle

Engine/source/gfx/gfxDrawUtil.cpp:768–796  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

766}
767
768void GFXDrawUtil::_drawSolidTriangle( const GFXStateBlockDesc &desc, const Point3F &p0, const Point3F &p1, const Point3F &p2, const ColorI &color, const MatrixF *xfm )
769{
770 GFXVertexBufferHandle<GFXVertexPCT> verts(mDevice, 3, GFXBufferTypeVolatile);
771 verts.lock();
772 // Set up the line strip
773 verts[0].point = p0;
774 verts[0].color = color;
775 verts[1].point = p1;
776 verts[1].color = color;
777 verts[2].point = p2;
778 verts[2].color = color;
779
780 // Apply xfm if we were passed one.
781 if ( xfm != NULL )
782 {
783 for ( U32 i = 0; i < 3; i++ )
784 xfm->mulP( verts[i].point );
785 }
786
787 verts.unlock();
788
789 GFXStateBlockRef sb = mDevice->createStateBlock( desc );
790 mDevice->setStateBlock( sb );
791
792 mDevice->setVertexBuffer( verts );
793 mDevice->setupGenericShaders();
794
795 mDevice->drawPrimitive( GFXTriangleList, 0, 1 );
796}
797
798void GFXDrawUtil::drawPolygon( const GFXStateBlockDesc& desc, const Point3F* points, U32 numPoints, const ColorI& color, const MatrixF* xfm /* = NULL */ )
799{

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