Original Post
When I run a program using the DrawText function the program crashes, example code: gd3dDevice->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 40, 100), 1.0f, 0); gd3dDevice->Clear(0, NULL, D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0); gd3dDevice->BeginScene(); gd3dDevice->SetFVF(CUSTOMFVF); D3DXMATRIX matView; D3DXMATRIX matTranslate; D3DXMATRIX matScale; D3DXMATRIX matRotateZ; D3DXMatrixLookAtLH(&matView, &D3DXVECTOR3 (x, y, z), &D3DXVECTOR3 (x + 20.0f, y, 0.0f), &D3DXVECTOR3 (0.0f, 0.0f, -1.0f)); gd3dDevice->SetTransform(D3DTS_VIEW, &matView); D3DXMATRIX matProjection; D3DXMatrixPerspectiveFovLH(&matProjection, D3DXToRadian(45), SCREEN_WIDTH / SCREEN_HEIGHT, 1.0f, 8192.0f); gd3dDevice->SetTransform(D3DTS_PROJECTION, &matProjection); RECT R = {5, 5, 0, 0}; mFont->DrawText(NULL, _T("Text"), -1, &R, DT_NOCLIP, D3DCOLOR_XRGB(0,0,0)); gd3dDevice->EndScene(); gd3dDevice->Present(NULL, NULL, NULL, NULL); The font: ID3DXFont* mFont; D3DXFONT_DESC fontDesc; fontDesc.Height = 18; fontDesc.Width = 0; fontDesc.Weight = 0; fontDesc.MipLevels = 1; fontDesc.Italic = false; fontDesc.CharSet = DEFAULT_CHARSET; fontDesc.OutputPrecision = OUT_DEFAULT_PRECIS; fontDesc.Quality = DEFAULT_QUALITY; fontDesc.PitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; _tcscpy(fontDesc.FaceName, _T("Times New Roman")); D3DXCreateFontIndirect(gd3dDevice, &fontDesc, &mFont); If I take out DrawText the program runs fine. Have I missed something? [Edited by - HarrisonPloeg on February 20, 2007 1:38:51 AM]