# D3D10 Sprites and primitive topology?

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

## Recommended Posts

Hi everyone.

I have been having a problem with text rendering for a while now, and can't seem to figure out what I'm doing wrong. I've managed to get a textured spinning pyramid up and running, but whenever I put the code specified below within my rendering loop, weird things happen. The text string i've defined gets output just like I want it, while the spinning pyramid has been replaced by a single dot moving along the same path as the pyramid used to. Same goes when I remove the DrawText method. I tried updating the primitive topology right after the pFontSprite->End(); resulting in the pyramid getting drawn again, but this time with its texture completely messed up alignment-wise.

 pFontSprite->Begin(D3DX10_SPRITE_SORT_TEXTURE); pFont->DrawText(pFontSprite, (LPCWSTR)ws, -1, &r, DT_NOCLIP, D3DXCOLOR(0.0f,1.0f,0.0f,1.0f)); pFontSprite->End(); 

Does anyone have any idea on what could be wrong in this case? I know it's not much to go on right now. Thanks in advance.

##### Share on other sites
[color="#000000"]I don't know much about sprites, but when using text you should restore some things afterwards like this:

 pDevice->OMSetDepthStencilState(0, 0); pDevice->OMSetBlendState(0, 0, 0xffffffff); pDevice->IASetInputLayout(pInputLayout); pDevice->IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST); 

Try to also pass D3DX10_SPRITE_SAVE_STATE as a parameter for pFontSprite->[color="#000000"]Begin.

##### Share on other sites
resetting the depth stencil state and blend state settled it, thanks alot for helping out

(edit: and the input layout also)

• 48
• 12
• 10
• 10
• 9
• ### Forum Statistics

• Total Topics
631379
• Total Posts
2999666
×