• 11
• 11
• 12
• 10
• 11

Why [pRect doesn't fit inside the surface]??

This topic is 4613 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I wrote these code in my program:
g_pd3dDevice-&gt;Clear(0,NULL,D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,D3DCOLOR_XRGB(0,0,0),1.0f,0);
if(SUCCEEDED(g_pd3dDevice-&gt;BeginScene())){

g_pd3dDevice-&gt;EndScene();

}
g_pd3dDevice-&gt;Present(NULL,NULL,NULL,NULL);
Surface-&gt;Release();

And before it,I use D3DXLoadSurfaceFromFile(Surface,NULL,NULL,Path,NULL,D3DX_FILTER_NONE,0,NULL) to load a jpg file to Surface,and i'm sure it's OK. But why i got these ERROR??What's these mean?thx~ Direct3D9: (ERROR) :pRect doesn't fit inside the surface Direct3D9: (ERROR) :Invalid dest rect specified. UpdateSurface failed [Edited by - Frente on September 6, 2005 1:51:28 AM]

Share on other sites
From the looks and the message this sounds as if BackBuffer doesn't have any size at all (is it set yet?).

Share on other sites
Oh i forgot it...
But if I want to load a image from a file and i set the size of BackBuffer bigger then the size of the image,the image didn't presents as it's normal size~
How to solve it ?
thx

Share on other sites
Then you need to set the destination rect in UpdateSurface the same size of your image.