bug in my FPS display
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.
Just something off the top of my head:
Assuming you are using a render loop like this:
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
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
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
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
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???
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???
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement