MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / DrawMaterial

Method DrawMaterial

Source/Engine/Render2D/Render2D.cpp:2018–2035  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2016}
2017
2018void Render2D::DrawMaterial(MaterialBase* material, const Rectangle& rect, const Color& color)
2019{
2020 RENDER2D_CHECK_RENDERING_STATE;
2021 if (material == nullptr || !material->IsReady() || !material->IsGUI())
2022 return;
2023
2024 // Auto-remove gamma flag if it's disabled
2025 Features &= IsRemoveGammaEnabled ? ~RenderingFeatures::None : ~RenderingFeatures::RemoveGamma;
2026
2027 Render2DDrawCall& drawCall = DrawCalls.AddOne();
2028 drawCall.Type = DrawCallType::Material;
2029 drawCall.StartIB = IBIndex;
2030 drawCall.CountIB = 6;
2031 drawCall.AsMaterial.Mat = material;
2032 drawCall.AsMaterial.Width = rect.GetWidth();
2033 drawCall.AsMaterial.Height = rect.GetHeight();
2034 WriteRect(rect, color);
2035}
2036
2037void Render2D::DrawBlur(const Rectangle& rect, float blurStrength)
2038{

Callers 2

DrawMethod · 0.45
DrawSelfMethod · 0.45

Calls 5

WriteRectFunction · 0.85
AddOneMethod · 0.80
GetWidthMethod · 0.80
IsReadyMethod · 0.45
GetHeightMethod · 0.45

Tested by

no test coverage detected