a sample code for dx9 doublebuffer ?

Started by
2 comments, last by codecow 8 years, 5 months ago

please. Present returns invalid call and i cant beat it.

Advertisement
Then show your set-up and run-time code.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

please give me email address.

main.cpp I am not permitted to upload this kind of file.

if you get this , and I know you get this:

hres=surf->LockRect(
&lr,
NULL,
NULL
);
if (!hres){
char *xptr=(char*)lr.pBits;
_asm{
mov eax,lr.Pitch
imul eax,50
add [xptr],eax
}
for (int i=0;i<95;i++) xptr=0x7f; //half white probably
surf->UnlockRect();
<< until this point . locks and the correct setup line
if this way : first working thing.
d3dpp.hDeviceWindow=hwnd;
d3dpp.BackBufferCount=0;
d3dpp.BackBufferWidth=width;
d3dpp.BackBufferHeight=height;
d3dpp.EnableAutoDepthStencil =FALSE;
d3dpp.Windowed = TRUE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
d3dpp.BackBufferFormat=modef;
d3dpp.AutoDepthStencilFormat=D3DFMT_D32;
d3dpp.PresentationInterval=D3DPRESENT_INTERVAL_DEFAULT;
or
d3dpp.hDeviceWindow = hwnd; // set the window to be used by Direct3D
d3dpp.BackBufferCount=1;
d3dpp.SwapEffect = D3DSWAPEFFECT_FLIP;
when I set this
d3dpp.Flags=D3DPRESENTFLAG_LOCKABLE_BACKBUFFER|D3DPRESENTFLAG_VIDEO;
//fails here
hres=dev->Present(&r,&r,Program.hwnd,NULL);
if (hres!=D3D_OK) {
if (hres==D3DERR_DEVICELOST){ OutputDebugString("device lost");}
if (hres==D3DERR_INVALIDCALL){ OutputDebugString("invalid call");}
if (hres==D3DERR_DRIVERINTERNALERROR){ OutputDebugString("driver error");}
OutputDebugString("present fail");
}else{
OutputDebugString("present ok");
}
i rather must send you source code.
????@lspiroengine.com

ah.rar works

This topic is closed to new replies.

Advertisement