Sign in to follow this  

Present and GetClientRectFailed

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

Hi, I know this question is perhaps a bit extreme without any code, but my code is so garbled in different units that I'm a bit scared to post it (even collect it) and hope my problem is a well known one. My call to Present Fails with an unknown Error. dbmon suggests: "GetClientRect failed?" I'm a bit confused. All my code until here seems to work well and doesn't result in anything different than D3D_OK. I call the Present function with no specification of Src- or DstRects and the sprite (ID3DXSprite) I want to draw seems also ok (I tried to save the texture I painted to the sprite per D3DXSaveTexture) and the file looks like it is supposed to. Maybe there are some specific points I should look into or something comes to your mind when you read this. I would be very happy about some help. Thanks in advance.

Share this post


Link to post
Share on other sites
It's difficult to say exactly what your problem is without any code :) But it seems as thought you may be calling the present function inside you begin / end scene block.

Make sure it's outside of the block, like below:

d3dDevice -> BeginScene();
// Render the scene...
d3dDevice -> EndScene();

d3dDevice -> Present(...);

Share this post


Link to post
Share on other sites
This failure happens when I enable DirectX debug runtime, even if I don't have any code other than a begin, end, and present. Or at least I remember it doing that a while back. I just disable debug runtime and re-enable it once in awhile to make sure things are going well. It's not the correct solution, but it is one.

Chris

Share this post


Link to post
Share on other sites
Thanks for your replies. I fear it's something else altogether. I just don't ger this failure. I can even use present in some procedures but not in others. Somewhere on the track all seems to break away.

Is there any way to check if the whole initialization and all of DirectX is ok on some specific point?

Share this post


Link to post
Share on other sites
Well, maybe I found my failure.

I initialized DirectX in the constructor of the Window with the Handle of the Panel (part of the window) it should paint to. This Handle seems to have changed before I call my Present routine. Could this be the cause or is a changing handle no problem at all (I don't even get a DeviceLost Return Value and even Device.TestCooperationLevel doesn't show anything else than D3D_OK?!?

Thanks in advance.

Share this post


Link to post
Share on other sites

This topic is 4854 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this