Jump to content
  • Advertisement
Sign in to follow this  
codecow

a sample code for dx9 doublebuffer ?

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

Advertisement

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 

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!