Advertisement

Blting to the 3D tile engine

Started by March 16, 2000 09:01 PM
3 comments, last by Houdini 24 years, 6 months ago
I was expirimenting with the "Using Direct3D For 2D Tile Rendering" engine and, for the life of me, I cannot figure out how to blt a simple mouse pointer to the screen. I do the normal "create an offscreen surface, load the bitmap onto the surface, and do a blt to the backbuffer" yet the Blt fails everytime. Does this have anything to do with Direct3D being part of the application? Someone please help!
- Houdini
Have you ever try the CDX wraper, it comes wit full! source code, I am sure it will help you.

http://www.cdx.sk

Oscar.

Advertisement
It''s not a good idea to mix 2D and 3D rendering unless you absolutely have to. The 2D rendering call must wait for the 3D rendering to finish before continuing, thus slowing down your game. Your mousepointer is best drawn as two texturemapped triangles in the form of a square.
And, if you''re using DirectX 7, you can use functions in the D3DX library that Microsoft ships with it to easily draw 2D-like sprites to D3D using 3D texture-mapped methods. (Its not too hard to do this yourself, in any case).
I recommend reading the thread on this in the directx forum, we were just discussing this! I''ve found that you can blit just fine as long as you do so before or after the BeginScene/EndScene calls.

This topic is closed to new replies.

Advertisement