CreateRenderTarget returns 0x80070057 in big surface resolution

Posted by senggen on Game Development See other posts from Game Development or by senggen
Published on 2012-09-20T08:12:14Z Indexed on 2012/09/20 9:52 UTC
Read the original article Hit count: 376

Filed under:
|
|

I have created the SLI merged desktop of three 1920x1680 monitors, so the desktop resolution is 5760x1080.

There is a 0x80070057 error, while calling CreateRenderTarget to create the RT_Surface:

IDirect3DSurface9* _render_surface;
HRESULT hr = _device->CreateRenderTarget(
        _desktop_width * 2,
        _desktop_height + 1,
        D3DFMT_A8R8G8B8, 
        D3DMULTISAMPLE_NONE, 
        0,
        TRUE,
        &_render_surface, NULL);

It works OK with desktop resolution 1024x768, and the total resolution is 3072x768.

In http://msdn.microsoft.com/en-us/library/windows/desktop/bb174361(v=vs.85).aspx, it says

If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be one of the following: D3DERR_NOTAVAILABLE, D3DERR_INVALIDCALL, D3DERR_OUTOFVIDEOMEMORY, E_OUTOFMEMORY.

and no description about 0x80070057.

HRESULT: 0x80070057 (2147942487)
Name: E_INVALIDARG
Description: An invalid parameter was passed to the returning function

Somebody please help me.

© Game Development or respective owner

Related posts about c++

Related posts about directx