• Advertisement

Archived

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

bug in my FPS display

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

Im using windows DrawText() function to display my frames per second on the screen. it worked fine until i started drawing 3d terrain with a skybox. now, it appears that the fps is being overdrawn by the terrain and/or the skybox. got ideas? please reply. not crucial, but still this annoys me a little. thanks.

Share this post


Link to post
Share on other sites
Advertisement
Just something off the top of my head:

Assuming you are using a render loop like this:


bool done = false;
while (done == false)
{
Checkforquit();
RenderScene();
}


Just put it at the end of everything else after your skybox and terrain is drawn.

May not work though, my knowledge is all SDL



-shadow

Share this post


Link to post
Share on other sites
DrawText is GDI. Just write a Text class for DirectX8

Heres the necessary code:

//Init
LPD3DXFONT g_Font;
LOGFONT LogFont = {24,0,0,0,FW_NORMAL,false,false,false,DEFAULT_CHARSET,OUT_TT_PRECIS,CLIP_DEFAULT_PRECIS,PROOF_QUALITY,DEFAULT_PITCH,"Arial"};
RECT FontPosition = {0,0,1024,768};

D3DXCreateFontIndirect(lpDevice,&LogFont,&g_Font);

g_Font->Begin();

char tmp[15];
sprintf(tmp, "%d", fps);

g_Font->DrawText(tmp,-1,&FontPosition,DT_LEFT,0xffffffff);
g_Font->End();

-CProgrammer
----------------------
My Website

Share this post


Link to post
Share on other sites
thanks a bunch.
but it appears that i can''t use that code right now because im using, although i have directx 8 sdk installed, i am calling directx 7 routines. i am working on a project that i started with directx7. is it fairly straight forward converting from dx7 to dx8??? basically, do i just replace all explicit dx7 calls with dx8, such as LPDIRECT3DDEVICE7''s???

Share this post


Link to post
Share on other sites

  • Advertisement