so i thought about doing a thread for the background, since the background took all the fps.
now my problem is that i draw the background but only a portion of it goes to the backbuffer, what it already draw by that time. any help?
my idea was to lock the backbuffer to draw this background and the unlocking it for the main procedur to finish and draw to the backbuffer, but not only it is stacking bad, it is also a bad idea in my opinion :\
S.O.S please, - - - _ _ _ ---
Code: Select all
DWORD WINAPI ThreadFn(LPVOID vpParam)
{
HRESULT result;
Game* newgame(NULL);//,kServ,mServ);
newgame = (Game*)vpParam;
DrawBMP( newgame->maplemap, -newgame->Mapx, newgame->Mapy,&newgame->gfx ,-1);
result = newgame->gfx.pDevice->Present( NULL,NULL,NULL,NULL );
assert( !FAILED( result ) );
return 0;
}
Code: Select all
theGame.gfx.BeginFrame();
theGame.ComposeFrame();
hThread = CreateThread(0, 0, ThreadFn, &theGame, 0, &qThreadID);
theGame.gfx.EndFrame();
//theGame.Go();