FPS++;
if ( timeGetTime() > oldTime + 1000 )
{
DisplayFPS = FPS;
FPS = 0;
oldTime = timeGetTime();
}
And I stuck it directly in my render loop. Then I use D3DXFonts to display the text. All my list''s and fans are default buffer settings and I''m thinking this might be why im getting such slow results. Or am I just going about the whole thing the wrong way? Any help for the matter would be greatly appreciated!
FPS : is only 40!?!?!
Hello out there... I''m using DirectX 9.0 to render a sky dome. Right now my code is very basic.
I''m using a tri fan for the top and a tri strip for the rest. I also am not even using lighting right now. I''m just rendering the unlit vertices with a blue diffuse degrade to simulate the sky for now. I''m taking it step by step.
But I decided once I''ve come this far it might be good to add a FPS counter to my application. I''m calculating like this.
1.) Use QueryPerformanceCounter / QueryPerformanceFrequency for timing. It''s much more accurate than timeGetTime().
2.) What, exactly, are you doing in your rendering loop? Post some code.
2.) What, exactly, are you doing in your rendering loop? Post some code.
OK... after switching my vertex buffer pooled settings to D3DPOOL_MANAGED. I now get 80 fps.... But i still think I sould get more!!! Is there anything else i should look at?
and check i will check the QueryPerf funtion...
and well it''s split up into classes and hard to post. but... this is basically what happens at the root of each loop right now.
Please ignor variable names... this is a prototype...
Does this help?
and well it''s split up into classes and hard to post. but... this is basically what happens at the root of each loop right now.
Please ignor variable names... this is a prototype...
void COberon::Update(){ tmpCamera.Update(); if ( bNeedUpdate ) { tmpFan.Update(); tmpStrip.Update(); tmpNormals.Update(); bNeedUpdate = false; } if ( bPause ) { tmpFan.SetFillMode(D3DFILL_WIREFRAME); tmpStrip.SetFillMode(D3DFILL_WIREFRAME); } else { tmpFan.SetFillMode(D3DFILL_SOLID); tmpStrip.SetFillMode(D3DFILL_SOLID); }}void COberon::Render(){ tmpFan.Render(); tmpStrip.Render(); if ( bShowNormals ) { tmpNormals.Render(); } FPS++; tmpFont.Write("FPS : %d", FPSDisplay); if ( timeGetTime() > oldTime + 1000) { FPSDisplay = FPS; FPS = 0; oldTime = timeGetTime(); }}
Does this help?
Note : that originally the pause flag was to top it from spinning ect... but i used it to toggle wire later cause it was there already.
And after getting 80 FPS... I changed nothing and it went back to 50. hrmmm... HELP!!! hehehe
lol... oh ok...
sorry...
i this what you mean?
sorry...
void CC3DTriangleFan::Render(){ //Has the vertex buffer been setup? if ( m_d3dvbVertexBuffer ) { //If so draw it m_lpd3dDevRef->SetStreamSource(0, m_d3dvbVertexBuffer, 0, sizeof(CC3DVertex)); m_lpd3dDevRef->SetFVF(D3DFVF_C3DVERTEX); m_lpd3dDevRef->SetRenderState(D3DRS_LIGHTING, m_bUseLighting); m_lpd3dDevRef->SetRenderState(D3DRS_FILLMODE, m_dwFillMode); m_lpd3dDevRef->DrawPrimitive(D3DPT_TRIANGLEFAN, 0, m_lSegmentCount - 2); m_lpd3dDevRef->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID); m_lpd3dDevRef->SetRenderState(D3DRS_LIGHTING, true); }}void CC3DTriangleStrip::Render(){ //Has the vertex buffer been setup? if ( m_d3dvbVertexBuffer ) { //If so draw it m_lpd3dDevRef->SetStreamSource(0, m_d3dvbVertexBuffer, 0, sizeof(CC3DVertex)); m_lpd3dDevRef->SetFVF(D3DFVF_C3DVERTEX); m_lpd3dDevRef->SetRenderState(D3DRS_LIGHTING, m_bUseLighting); m_lpd3dDevRef->SetRenderState(D3DRS_FILLMODE, m_dwFillMode); m_lpd3dDevRef->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, m_lSegmentCount - 2); m_lpd3dDevRef->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID); m_lpd3dDevRef->SetRenderState(D3DRS_LIGHTING, true); }}
i this what you mean?
Please stop double, triple, and quadruple posting in your replies. You seem to do it a lot in the threads you post in. There is an edit button for a reason -- don''t post 4 times in a row.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement