PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Direct3D w/ GapiDraw

I have been using my own 3D engine with GapiDraw on the Pocket PC, but I'm porting my program to the PC and would like to use Direct3D for the desktop version.

I'm new to Direct3D, and the only way I could figure out how to use GapiDraw and Direct3D together was to copy the contents of my Direct3D back buffer to my GapiDraw back buffer, but this is really slow.

Does anyone know the best way to use GapiDraw and Direct3D together? Thanks.
Hm. I guess that the problem is that you want to use GapiDraw as an overlay to your 3D background. That way you have to read the contents of the backbuffer, which is painfully slow (reading videomemory is much slower than writing to it).

I guess I could add an interface to CGapiSurface that returns the LPDIRECTDRAW surface pointer behind it. And that way I guess you could create a texture based on that surface. But then it's the problem with alpha blending the texture in front of the 3D render (to simulate an overlay).. Hm.

Unfortunately I don't have any good ideas to this.
Hey Johan,

All I want to do is to draw my 3D stuff and then have GapiDraw draw on top of that. No fancy effects needed. :)

My thought was to have Direct3D use GapiDraw's back buffer. So Direct3D would draw first onto it and then GapiDraw would draw next. Would that be possible?
Is there a way I can have GapiDraw only update to a portion of the screen defined by a RECT?