ID3DX10Font* mFont;
.
D3DX10_FONT_DESC fontDesc;
fontDesc.Height = 24;
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;
wcscpy(fontDesc.FaceName, L"Times New Roman");
D3DX10CreateFontIndirect(g_pd3dDevice, &fontDesc, &mFont);
.
RECT R = {5, 5, 0, 0};
mFont->DrawTextW(0, mFrameStats.c_str(), -1, &R, DT_NOCLIP, WHITE);
g_pSwapChain->Present( 0, 0 );
dx 10 c++ font and sprites
hy.
I'm tring to draw some text in my c++ dx10 application like this:
But i have some textured and non meshes in my application , and when i draw text all my textured meshes appear wrong.
I read that the text change silently the state of the device!
is true?
how i can resolve?
Thanks
i'm try , but not work , when i call drawtext all the meshes remain wrong.
Have two lines of code for explain your solution?
Thanks
Have two lines of code for explain your solution?
Thanks
try the following after using drawfont (dont know which of these commands you really need:
md3dDevice->OMSetDepthStencilState(0, 0);md3dDevice->OMSetBlendState(0, {0.0f, 0.0f, 0.0f, 0.0f}, 0xffffffff);md3dDevice->IASetInputLayout(VertexLayoutVariable);md3dDevice->IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement