| 27 | } |
| 28 | |
| 29 | void GraphicsEngine::SetFont(std::shared_ptr<Font> const& font) |
| 30 | { |
| 31 | LogAssert(font != nullptr, "Input font is null."); |
| 32 | if (font != mActiveFont) |
| 33 | { |
| 34 | // Destroy font resources in GPU memory. The mActiveFont should |
| 35 | // be null once, only when the mDefaultFont is created. |
| 36 | if (mActiveFont) |
| 37 | { |
| 38 | Unbind(mActiveFont->GetVertexBuffer()); |
| 39 | Unbind(mActiveFont->GetIndexBuffer()); |
| 40 | Unbind(mActiveFont->GetTextEffect()->GetTranslate()); |
| 41 | Unbind(mActiveFont->GetTextEffect()->GetColor()); |
| 42 | Unbind(mActiveFont->GetTextEffect()->GetVertexShader()); |
| 43 | Unbind(mActiveFont->GetTextEffect()->GetPixelShader()); |
| 44 | } |
| 45 | |
| 46 | mActiveFont = font; |
| 47 | |
| 48 | // Create font resources in GPU memory. |
| 49 | Bind(mActiveFont->GetVertexBuffer()); |
| 50 | Bind(mActiveFont->GetIndexBuffer()); |
| 51 | Bind(mActiveFont->GetTextEffect()->GetTranslate()); |
| 52 | Bind(mActiveFont->GetTextEffect()->GetColor()); |
| 53 | Bind(mActiveFont->GetTextEffect()->GetVertexShader()); |
| 54 | Bind(mActiveFont->GetTextEffect()->GetPixelShader()); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | uint64_t GraphicsEngine::Draw(Visual* visual) |
| 59 | { |
nothing calls this directly
no test coverage detected