| 2016 | } |
| 2017 | |
| 2018 | void 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 | |
| 2037 | void Render2D::DrawBlur(const Rectangle& rect, float blurStrength) |
| 2038 | { |