Jump to content
  • Advertisement
Sign in to follow this  
papulko

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.

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

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 this post


Link to post
Share on other sites
Advertisement
[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.
I hope this will help you.

Share this post


Link to post
Share on other sites
resetting the depth stencil state and blend state settled it, thanks alot for helping out rolleyes.gif

(edit: and the input layout also)

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!