MCPcopy Create free account
hub / github.com/carbonengine/trinity / DrawText

Method DrawText

trinity/Tr2DebugRenderer.cpp:721–743  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

719}
720
721void Tr2DebugRenderer::DrawText( TriDebugFont font, const Vector3& pos, const Color& color, const char* msg, ... )
722{
723 va_list args;
724 va_start( args, msg );
725
726 Tr2Rect rect;
727 USE_MAIN_THREAD_RENDER_CONTEXT();
728 Tr2Viewport vp;
729 renderContext.GetViewport( vp );
730
731 Vector3 screenPos = Tr2Renderer::ProjectWorldToScreen( pos, vp );
732
733 if( ( screenPos.z > 0.0f ) && ( screenPos.z < 1.0f ) )
734 {
735 rect.top = (int32_t)screenPos.y;
736 rect.left = (int32_t)screenPos.x;
737 rect.bottom = rect.top + 512;
738 rect.right = rect.left + 1024;
739
740 GetDebugTextRenderer().Vprintf( font, rect, TRI_DFS_LEFT, Vector4( color.r, color.g, color.b, color.a ), msg, args );
741 }
742 va_end( args );
743}
744
745void Tr2DebugRenderer::Pick( EvePendingPickingReadback& readback, bool synchronize, Tr2RenderContext& renderContext )
746{

Callers 6

RenderDebugInfoMethod · 0.45
RenderDebugInfoMethod · 0.45
RenderDebugInfoMethod · 0.45
RenderDebugInfoMethod · 0.45
RenderDebugInfoMethod · 0.45

Calls 3

VprintfMethod · 0.80
Vector4Class · 0.50
GetViewportMethod · 0.45

Tested by

no test coverage detected