Example #1
0
void DrawGlyphTex()
{
	g_pDevice->BeginRendering(true, true, true);

	ZFXMatrix mWorld;
	mWorld.Identity();
	g_pDevice->SetWorldTransform(&mWorld);
	
	Font *pFont = g_pDevice->GetFontManager()->GetFont(g_fontID);
	UINT nSkinID = pFont->GetSkinID(33);

	g_pDevice->SetTextureStage(0, RS_TEX_ADDSIGNED);
	g_pDevice->GetSkinManager()->ActiveSkin(nSkinID);
	glBindVertexArray(g_vao);
	glBindBuffer(GL_ARRAY_BUFFER, g_vertex);
	glVertexPointer(2, GL_FLOAT, 4 * sizeof(GLfloat), 0);
	glTexCoordPointer(2, GL_FLOAT, 4 * sizeof(GLfloat), (void*)(2 * sizeof(float)));
	glEnableClientState(GL_VERTEX_ARRAY);
	glEnableClientState(GL_TEXTURE_COORD_ARRAY);


	glDrawArrays(GL_TRIANGLES, 0, 6); 

	GLenum error = glGetError();
	if (error != GL_NO_ERROR)
	{
		int i = 0;
	}

	g_pDevice->EndRendering();

}
Example #2
0
void InitFont()
{
	IFontManager* fm = g_pDevice->GetFontManager();
	if (fm)
	{
		fm->CreateFont("VeraMono", "fonts/VeraMono.ttf", 60, &g_fontID);
		Font* pFont = fm->GetFont(g_fontID);
		pFont->AddCodePointRange(33, 255);
		pFont->LoadFont();
	}
}