I recently upgraded to version 1.07 of unDelphiX because I wanted to take advantage of the graphic acceleration for alpha blending, only to find that if I activate the 3D/hardware acceleration, then it no longer supports multiple surfaces which I do use.
My game is a 2D turn based map game (division level WWII game). I don't need a high FPS, just need to be able to scroll the map and zoom in and out quickly. When the user moves his cursor over the map, then map is updated to show where the cursor is and display information re: the hex, and I do this using multiple surfaces as follows: (1) draw the map to a background surface, (2) when the cursor moves, draw the background surface to the dxdraw.surface and then update the dxdraw.surface to reflect what the cursor is doing, and (3) flip the dxdraw.surface to the screen. I use other surfaces for other effects too.
Maybe I could copy the canvas of dxdraw.surface to a graphic (instead of a background surface) and then load the graphic into dxdraw.surface whenever the user moves the cursor. And instead of having a surface with a hex grid, I could just redraw each time I render the map. But this seems to gut most of the advantages of DirectX. The tdirectdrawsurface methods are all based on another surface being drawn to the surface, and not being able to use this removes much of the functionality of DelphiX.
Alternatively, I could not use the acceleration, but the alpha drawing is so slow. My game shades certain hexes to show which are friendly and which are enemy hexes. However the alpha blending is so slow (without acceleration) that currently I copy the surface.canvas into a bitmap and then I do a pixel by pixel alpha blend in a method I wrote, and this works 2 or 3 times faster than when using the alpha drawing method in unDelphiX!
Any suggestions? I feel like I should switch to another graphics library, but I am reluctant to have to port all my code to a a new graphic system. I took a quick look at Asphyre Casual Framework, but there does not appear to be any documentation and it does not have Delphi components like DelphiX. The examples I saw did not appear to use surfaces either (though I only spent a short time looking through the examples). Any suggestions?
Bookmarks