why does calling this function mess up the depth buffer? I read somewhere that it cheekily changes the blend state, but to be totally honest I don't even know what that means. What is it doing, why is it doing it and what should I do about it?
Here is my code... instantiation:
RECT rct; D3DXCOLOR fontColor = D3DXCOLOR(255,0,0,255); LPD3DX10FONT m_font; LPD3DX10SPRITE m_sprite;
rct.left=200; rct.right=780; rct.top=200; rct.bottom=rct.top+20; D3DX10CreateFont(device, 16, 0, FW_BOLD, 0, FALSE, DEFAULT_CHARSET, OUT_TT_ONLY_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH | FF_DONTCARE, L"Verdana", &m_font); D3DX10CreateSprite(device, 256, &m_sprite);
m_sprite->Begin(D3DX10_SPRITE_SAVE_STATE); std::ostringstream oss; oss << "This ruins the depth buffer!!!" << agents.State(); std::string test = oss.str(); m_font->DrawTextA(m_sprite, test.c_str(), -1, &rct, DT_LEFT|DT_NOCLIP , fontColor); m_sprite->End();
as a side question, is there a more succinct way I can append variables to the string being written?