Original Post
I use
if(FAILED(g_pd3dDevice->CreateTexture(512 , 512 , 1 , D3DUSAGE_RENDERTARGET , D3DFMT_A8R8G8B8 , D3DPOOL_DEFAULT , &g_pRenderTexture , 0)))
to create a texture, then render the scene to it.
windows is:
HWND hWnd = CreateWindow("Render to Texture" , "Render to Texture"
, WS_OVERLAPPEDWINDOW , 0 , 0 , 640 ,480 , GetDesktopWindow()
, 0 , wndClass.hInstance , 0);
But the result is wrong.The scene is not rendered right.
But if I change the texture's width and hight to 256,256,
or increase window's width and hight more than 512 ,for example 1024,560,
the result is right.
How to explain this?
if(FAILED(g_pd3dDevice->CreateTexture(512 , 512 , 1 , D3DUSAGE_RENDERTARGET , D3DFMT_A8R8G8B8 , D3DPOOL_DEFAULT , &g_pRenderTexture , 0)))
to create a texture, then render the scene to it.
windows is:
HWND hWnd = CreateWindow("Render to Texture" , "Render to Texture"
, WS_OVERLAPPEDWINDOW , 0 , 0 , 640 ,480 , GetDesktopWindow()
, 0 , wndClass.hInstance , 0);
But the result is wrong.The scene is not rendered right.
But if I change the texture's width and hight to 256,256,
or increase window's width and hight more than 512 ,for example 1024,560,
the result is right.
How to explain this?