D3DIM Framework problem

Started by
4 comments, last by JonHobson 23 years, 11 months ago
I''ve always wondered why in the DirectX 7 d3dim framework samples if I put: m_bShowStats = FALSE; the app basically slows to the point where it seems to have locked up. I''ve found the cause of the slowdown: It happens if I don''t aquire and release a device context from the render target every frame (this happens in OutputText if m_bShowStats = TRUE). I dont know whether this is just a problem with my computer or what, because the same thing happens with the non D3DFramework IM samples. E.g. the simple triangle sample runs at less than 1 FPS, I know this sample is non H/W but I think thats abnormally slow. If anyone knows why this is happening please help, because just getting then releasing a HDC per frame for no reason is just wasting frames.
---------- JonHobson ----------

Advertisement
You shouldn''t have to get and release the device context at all. In fact doing so can slow your program (if the 3D accelerator was busy at the time). You should instead see a slight increase in frame rate if you don''t show the stats. There must be something else that you have missed that are causing the slowdown.

- WitchLord

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Nope, I''ve turned ShowStats off, inserted an OutputText call into my code. I''ve commented out most of the code in output text so it looks like this:

VOID CD3DApplication::OutputText( DWORD x, DWORD y, TCHAR* str )
{
HDC hDC;

// Get a DC for the surface. Then, write out the buffer
if( m_pddsRenderTarget )
{
if( SUCCEEDED( m_pddsRenderTarget->GetDC(&hDC) ) )
{
m_pddsRenderTarget->ReleaseDC(hDC);
}
}
}

This runs at full speed 75 FPS.

if I take out this

if( SUCCEEDED( m_pddsRenderTarget->GetDC(&hDC) ) )
{
m_pddsRenderTarget->ReleaseDC(hDC);
}

then the app runs SLOW. and I mean < 1 fps slow. I have to hold down the ESC key for about 10 seconds for the program to quit!
---------- JonHobson ----------

Well, I don''t know what to say. This is truly a mystery for me.

Let me try some questions that I want you to answer:

What graphic card do you have?
Did you install the debug runtime when installing the SDK?
Does the problem exist in both hardware and software mode?
Have you tried without D3DFramework?
Was the problem still there?
What operative system do you run (95, 98, 2000)?

I''m just shooting of some questions here, hoping that maybe some can give you a clue to the problem.

Just to make sure I wasn''t making any mistake in my assumptions earlier I tried turning of the stats in one of the samples, and it didn''t slow down. I believe it went faster but since I couldn''t read the FPS I''m not sure.


- WitchLord

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

It seems to only happen with the SDK''s included D3DIM samples. I''ve tried some code I got from the internet that uses the Framework, and that works without the HDC. I''ll have to look through it to see how it does it.

I used to be able to turn off the stats in the samples in DX6 and lower though. Also there is no change in software mode, well apart from being even slower.

To answer your questions: My graphics card is a Voodoo Banshee AGP 16MB, and I''m using the Release version of the DXSDK on WIN98. I also have a TV/Radio card that uses DDraw overlays and I''m suspicious about whether that may be causing the problem.
---------- JonHobson ----------

I think you are on your own with this. I hope you figure it out.

Here''s one more question to think about:

Is the problem persistent in windowed and fullscreen mode?

- WitchLord

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement