Archived

This topic is now archived and is closed to further replies.

MasterWorks_Software

Help with device.Present parameters

Recommended Posts

Hey all, I''m trying to implement a ''screen shake'' effect for explosions by copying the backbuffer with an offset (that decreases quickly over time). For instance, I''d like to present the backbuffer with everything offset by 10 pixels across and -5 pixels down. The next frame it will choose new, random offsets. I create the device using D3DSWAPEFFECT_COPY. I''m using Direct3D8/Visual Basic. I''ve been looking thru the SDK and this is all I can find for help on the present parameters: mD3DDevice.Present ByVal 0, ByVal 0, 0, ByVal 0 This example is given over and over. But I don''t want to pass Byval 0, I want to pass a rectangle!! Everything I''ve tried just gives an automation error. Does anybody know how to do this in VB? I tried Dim region as RECT (fill members of region) mD3DDevice.Present ByVal 0, region, 0, ByVal 0 but no luck. How do I do this? Why is this not better documented???? -Jay

Share this post


Link to post
Share on other sites
I havn''t ever done this myself, but offhand id say u''d want to move the camera. The back buffer is just a term for an area of memory, would be well tricky doing it ut way.

regards,

ace

Share this post


Link to post
Share on other sites
Moving the camera is not an option, my game uses a hefty blend of 2D T&L quads as well as 3D meshes rendered using a variety of view/world/projection matrices, etc. I am looking for a way to present the backbuffer but not necessarily starting at (0,0). I used to do this with DirectDraw and the effect was exactly as I wanted.

I understand that the backbuffer is just an area of memory; why would copying that memory to a slightly different location be more difficult than the incredible task of doing it by moving all my different cameras??

The device.Present seems to accept the exact parameters I am looking for. I do not understand how to set up the correct RECT structure and pass it using Visual Basic (although surely the C++ method is awfully similar).

Share this post


Link to post
Share on other sites