Jump to content
  • Advertisement

Archived

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

JonHobson

D3DIM Framework problem

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

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!