Jump to content
  • Advertisement
Sign in to follow this  
giugio

dx 10 c++ font and sprites

This topic is 3162 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hy. I'm tring to draw some text in my c++ dx10 application like this:
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 );


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

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!