Skip to main content
GameDev.net gamedev.net
🔒 Locked

big problem

Started by russian-bear Apr 21, 2002 at 12:35 PM 7 replies 250+ views
Original Post
russian-bear
russian-bear
Hi! Im in trouble...... When i run my app in windowed mode i get about 1200 fps on my GF4. But when i try to switch to fullscreen fps drops down to 7 !!!!! do you belive it 7! This is my presentation parameters: // Width of the back buffer in pixels d3dpp.BackBufferWidth = bWindowed ? 0 : GAMEAREA_WIDTH; // Height of the back buffer in pixels d3dpp.BackBufferHeight = bWindowed ? 0 : GAMEAREA_HEIGHT; // Back buffer format d3dpp.BackBufferFormat = bWindowed ? d3ddm.Format : D3DFMT_A8R8G8B8; // Number of back buffers d3dpp.BackBufferCount = 1; // Multisampling type d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE; // Swap effect d3dpp.SwapEffect = D3DSWAPEFFECT_COPY; // Window handle where rendering ocures d3dpp.hDeviceWindow = hWndTarget; // Windowed or fullscreen d3dpp.Windowed = bWindowed; // Let Direct3D manage the depth buffer d3dpp.EnableAutoDepthStencil = TRUE; // Set the depth buffer format to 16 bits d3dpp.AutoDepthStencilFormat = D3DFMT_D16; // Use the default refresh rate available d3dpp.FullScreen_RefreshRateInHz = 0; // Present the information as fast as possible d3dpp.FullScreen_PresentationInterval = bWindowed ? 0 : D3DPRESENT_INTERVAL_IMMEDIATE; // Allow the back buffer to be accessed for 2D work d3dpp.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER; // Acquire a pointer to IDirect3DDevice8 hResult = g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWndTarget, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &g_pD3DDevice ); if( FAILED( hResult ) ) { OutputDebugString( "Could not create the render device" ); return E_FAIL; } Please help me if you see whats wrong.....
< There are no stupid questions, only stupid answers! >
Mezz
Mezz
How are you outputting your fps?

If it''s in real time, don''t use GDI.

Apart from that I''m not really a d3d guru.
Er, but maybe the software vertex procoessing should be changed, if it''s possible to do it in hardware?

-Mezz
siaspete
siaspete
None of these may solve your problem, but...

* Sometimes you''ll get better performance if your depth bits per pixel matches your colour bits per pixel.

* Not many cards support alpha in the back buffer, try changing to D3DFMT_X8R8G8B8 (or whatever).


Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
IndirectX
IndirectX
To add to the above posts: Why do you need D3DSWAPEFFECT_COPY and D3DPRESENTFLAG_LOCKABLE_BACKBUFFER anyway? They can slow you down considerably.
---visit #directxdev on afternet <- not just for directx, despite the name
russian-bear
russian-bear
ok i changed to theese settings but still i get only 60 fps...


// Width of the back buffer in pixels
d3dpp.BackBufferWidth = bWindowed ? 0 : GAMEAREA_WIDTH;
// Height of the back buffer in pixels
d3dpp.BackBufferHeight = bWindowed ? 0 : GAMEAREA_HEIGHT;
// Back buffer format
d3dpp.BackBufferFormat = bWindowed ? d3ddm.Format : D3DFMT_A8R8G8B8;
// Number of back buffers
d3dpp.BackBufferCount = 1;
// Multisampling type
d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE;
// Swap effect
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
// Window handle where rendering ocures
d3dpp.hDeviceWindow = hWndTarget;
// Windowed or fullscreen
d3dpp.Windowed = bWindowed;
// Let Direct3D manage the depth buffer
d3dpp.EnableAutoDepthStencil = TRUE;
// Set the depth buffer format to 16 bits
d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
// Use the default refresh rate available
d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
// Present the information as fast as possible
d3dpp.FullScreen_PresentationInterval = bWindowed ? 0 : D3DPRESENT_INTERVAL_DEFAULT;
// Allow the back buffer to be accessed for 2D work
d3dpp.Flags = 0;
< There are no stupid questions, only stupid answers! >
IndirectX
IndirectX
Now your vsync is kicking in.
---visit #directxdev on afternet <- not just for directx, despite the name
Shadows
Shadows
60 ain''t normal for not rendering anything when you get 1200 in windowed mode... nope as IndirectX said it''s (probably) your vsync kicking in... change D3DPRESENT_RATE_DEFAULT to D3DPRESENT_RATE_UNLIMITED and change D3DPRESENT_INTERVAL_DEFAULT to D3DPRESENT_INTERVAL_IMMEDIATE...

Regards Shadows
russian-bear
russian-bear
Thanks! ''Shadows'' ..... D3DPRESENT_RATE_UNLIMITED didnt work but when i changed to D3DPRESENT_INTERVAL_IMMEDIATE i got 1800 fps in fullscreen mode !!!

stevenmarky if you dont belive those high framerates then you probably never seen a GF4 Ti200 in action !

Thank you verry mutch all helpful people !!!
< There are no stupid questions, only stupid answers! >

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.