Jump to content
  • Advertisement

Archived

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

snakekain

problems using directx9 StretchRect

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

when i use stretch rect that way hr = pdirect->StretchRect(offscreen, &videorect, backbuffersurface, NULL, D3DTEXF_NONE))) if(FAILED(hr)) MessageBox(NULL,"failed in stretch rect","failed in stretch rect",MB_OK); the off screen created the with d3dpool default the "(backbuffersurface)" is the backbuffer surface i tried with setting the flag D3DPRESENTFLAG_LOCKABLE_BACKBUFFER and without setting it. the off screen format is D3DFMT_A8R8G8B8 the back buffer "(backbuffersurface)" is d3dfmt_unknown in windowed mode the display of the desktop is 32 bit. thanks for advance and i appreciated any help.

Share this post


Link to post
Share on other sites
Advertisement
the documentation gives only two possible return values D3D_OK AND D3DERR_INVALIDCALL since the FAILED macro returned true this means the function StretchRect returned D3DERR_INVALIDCALL.
you see the problem is that the function fails and i don''t know why thanks for your reply.

Share this post


Link to post
Share on other sites
Ok, but even though the docs say there are two return values, that doesn''t mean that these are the ONLY possible return values. Since the D3D device is a COM object, there could be any number of return values. That''s the whole reason it''s better to use the FAILED and SUCCEEDED macros instead of checking for the specific return values for each function.

Whenever a D3D function fails, there should be some kind of debug output that gives you an idea of why it failed. Make sure your debug output level is at maximum. If you aren''t sure what I''m talking about, go to Control Panel and click on the DirectX icon. In the Direct3D tab make sure that you have a bullet beside "Use Debug version of Direct3D" and make sure that the Debug Output Level is as far to the right as can be.

The debug output should give you a better idea as to why the function fails and then maybe either you can figure it out or the people here on the board can have a better idea as to what to suggest.

neneboricua

Share this post


Link to post
Share on other sites
Thank you i now got it i just used an invalid rect this was the problem.
The debug output tip was very helpfull. I think it will help me with other problems too.I''m so gratefull.Thanks for your reply.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!