Skip to content

Instantly share code, notes, and snippets.

@Shaptic
Last active December 12, 2015 03:09
Show Gist options
  • Save Shaptic/4705214 to your computer and use it in GitHub Desktop.
Save Shaptic/4705214 to your computer and use it in GitHub Desktop.
CFont::CFont() constructor.
CFont::CFont() : m_ready(false), m_loaded(false)
{
// Initialize FreeType.
if(!CFont::Initialize()) return;
// Load the shader.
if(!m_FontRender.LoadFromFile("Default.vs", "FontRender.fs"))
return;
// Give the font shader an identity matrix for the model-view
// and the projection matrix that was created with the window.
m_FontRender.Bind();
if(!m_FontRender.SetMatrix("modelview", math::IDENTITY_MATRIX) ||
!m_FontRender.SetMatrix("proj", CWindow::GetProjectionMatrix()))
return;
m_FontRender.Unbind();
m_ready = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment