Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Multiverse

LPD3DXFONT variable output

This topic is 5300 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

Hey there, currently starting out making a 3D game using DX9, and have implemented some LPD3DXFONT code in order to help debugging (output mesh location/orientation/speed etc) with LPD3DXFONT its relatively easy to output strings on screen, but how do i output variables in a simple and quick way? thanks for your time "what do you mean its on the wrong line? That wont work... Oh, it worked."

Share this post


Link to post
Share on other sites
Advertisement
std::ostringstream ossFps;

ossFps << "FPS: " << pTimer->GetFps();

pFont->DrawText(pSprite, ossFps.str().c_str(), -1, &Rect, DT_LEFT|DT_NOCLIP, 0xffffffff);

Share this post


Link to post
Share on other sites
Hi again guys. I the two suggestions sprintf() and the ostringstream method and im running into problems on both of them.

i got basic text working with both methods but not the variables i wanted to display. for example, when using the ostringstream method i get the text but my value just shows as 0 no matter what i change the variable to.

i was wondering if you could elaborate a bit on your method eFoDay like what the ''pSprite'' variable is and does. I removed the ''-1'' and replaced it with a finite number and completely removed the pSprite which is probably where im going wrong and why i want to know wot its for!

Any extra info would be greatly appreciated.

Share this post


Link to post
Share on other sites
pSprite can be NULL, in which case Microsoft® Direct3D® will render the string with its own sprite object.

If Count is -1, then the pString parameter is assumed to be a pointer to a null-terminated string and ID3DXFont::DrawText computes the character count automatically.

Share this post


Link to post
Share on other sites
cheers eFoDay. a really appreciate the help. i like how u put the registered trademark symbols after microsoft and Direct3D.

thanks again!

"what do you mean its on the wrong line? That wont work... Oh, it worked."

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!