Skip to main content
gamedev.net
🔒 Locked

speedproblems

Started by Kaesebrot Oct 24, 2001 at 6:13 PM 0 replies 300+ views
Original Post
Kaesebrot
Kaesebrot
I have created a LPDIRECT3DSURFACE8 with the function CreateRenderTarget(...) - I "activate" my created surface with SetRenderTarget(...) - I render something to this target - I call SetRenderTarget(...) again to "reactivate" rendering to my backbuffer - I call CopyRects(...) to copy my created surface into the backbuffer - I flip the backbuffer with frontbuffer Hmmm.. I think it´s a bit slow... here is some code //Variables LPDIRECT3DDEVICE8 lpd3ddevice; LPDIRECT3DSURFACE8 lpd3dsback; //backbuffe LPDIRECT3DSURFACE8 lpd3dsStencil; //zbuffer LPDIRECT3DSURFACE8 lpd3dsImage; //Image-Surface LPDIRECT3DTEXTURE8 lpd3dSprite; //Init lpd3ddevice->CreateRenderTarget(500, 500, (the right format), D3DMULTISAMPLE_NONE, false, &lpd3dsImage); //Gameloop lpd3ddevice->SetRenderTarget(lpd3dSprite, NULL); lpd3dSprite->Begin(); lpd3dSprite->Draw(...); lpd3dSprite->End(); lpd3ddevice->SetRenderTarget(lpd3dsback, lpd3dsStencil); lpd3ddevice->CopyRects(lpd3dsImage, ...); lpd3ddevice->Present(NULL, NULL, NULL, NULL); this is just an example.. it´s very simple and can be solved in another way... I want to blit something to an "Image" - I don´t want to do this in every frame I want to copy the entire "Image" or only a part to backbuffe - every frame Is there a faster way than mine...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.