MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / SetFont

Method SetFont

GTE/Graphics/GraphicsEngine.cpp:29–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29void 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
58uint64_t GraphicsEngine::Draw(Visual* visual)
59{

Callers

nothing calls this directly

Calls 3

GetTranslateMethod · 0.80
GetVertexBufferMethod · 0.45
GetIndexBufferMethod · 0.45

Tested by

no test coverage detected