• Advertisement
Sign in to follow this  

Viewing framerate directx

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

I dont understand what the string pointer, is to be, to display my framerate. Using ID3DXFONT::DrawText Looking around, i think it has something to do with the createDevice D3DPRESENT_PARAMETERS, but i'm not sure what. Thanks.
#include <string>

static RECT myRect; SetRect(&myRect, 0, 0, 640, 480); 

//Pointer is just psuedo for what is ment to be there..
int stringLength = pointer.length();

int DrawText(NULL,
  &pointer,
  stringLength,
  &myRect,
  DT_LEFT,
  D3DCOLOR_RGBA(255,255,255,255));

Share this post


Link to post
Share on other sites
Advertisement
Thanks for getting back to me, i'm not sure what str does though.
Does it return the length of the string?

Share this post


Link to post
Share on other sites
It returns a null terminated C string. Essentially it just returns a pointer to the buffer the string encapsulates. Depending on the length of the string, this either resides within the string object itself, or is allocated later on.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement