Jump to content
  • Advertisement
Sign in to follow this  

dx 10 c++ font and sprites

This topic is 3337 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
i'm try , but not work , when i call drawtext all the meshes remain wrong.
Have two lines of code for explain your solution?

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);

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!