• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 

DDS loading and use in DelphiX

Started by dbots, 27 March 2010, 10:24:07

Previous topic - Next topic

dbots

Quote from: Galfar on  5 April 2010, 19:37:58
Check out TDXImageList class mentioned in this forum thread http://delphigamedev.com/forums/viewtopic.php?f=2&t=1185.

I think you can't get any alpha blending simply by using Surface.Draw methods (http://www.gamedev.net/community/forums/topic.asp?topic_id=303701 - it would have to be hardware supported to work).


Thanks for replying. I have been using a previous version of DelphiX until now (before having the need to use images that contain alpha channels [dds/png]) and up to now everything was just fine.
I have also found this article you sent about TDXImagelist and tried that using the latest version of UnDelphiX, but that version has a very bad memory management. My project that with previous version used about 150 MB or RAM with everything loaded, compiled with new version and no other changes uses about 1,2 GB of RAM. Well, this is bad.
On the other hand, that latest UnDelphiX version displays 32bit bitmaps (with alpha channel) fine, but what can I do if memory management is so bad ?
I contact the maintainer of unDelphiX many times but had no reply about this so I returned back to previous version I used and try to find some other solutions to use together with that previous version of DelphiX.
BTW, that old version of DelphiX I use, supports hardware acceleration by using Do3D=TRUE and I use it like that - no problem with that.
What would you suggest ? (please note that if I could use PNG images that keep alpha channel, that also would be fine for me). As I wrote in the past, I used PNG images by adding PNGImage in the uses clause of my application, but the only way I could draw them so that they keep their alpha channel over DX surface, was by drawing on the canvas of the DXSurface (form1.dxdraw1.surface.canvas.draw) that needs a "form1.dxdraw1.surface.canvas.release" afterwards, not directly on the form1.dxdraw1.surface. So this (drawing on canvas) made things very slow on most systems.
Please send any suggestions.

Galfar

In that last version of UnDelphiX which eats a lot of memory how do you display those 32bit images with alpha? You must use that TDXImageList or does it work with Surface.Draw as well?

With the code I sent you earlier you can convert any format with alpha channel (PNG, DDS, TGA, JNG, ...) to DIB32. Using TCanvas to draw anything is usually too slow for realtime usage.


I guess switching from DelphiX to another library is not an option for you, right?


dbots

To display 32bit images in last version of unDelphiX, use :

form1.DXImageList1.Items.Find('image1dib').Draw(form1.DXDraw1.Surface, tmpx, 100, 0);

All work fine with that, except memory.

I tried to switch to Andorra 2D, since I read that it's not very difficult to transfer a project written for DelphiX to Andorra2D, but I found some unexplained parts there, asked the maintainer and got some answers but not all, so I started transferring my project, done almost half work and now I am stack.

With the code you sent, OK I can transform to DIB32 but the old DelphiX I use cannot handle alpha channels in DIB32. Only latest unDelphiX can, but this has the memory problems.
Also, the maintainer of unDelphiX has written a tool "PNG2DIB" that does exactly this. But as things are not, with that memory problem, I see no usage to do that.

I would like to have a quick solution for that problem I have now (displaying of DDS or PNG images) but of course if this is not possible I have to start using to other library.
But I would like the new library to :
- have very good support
- very good documentation and examples
- be able to do modern projects

Do you have any suggestions ?

Galfar

I would definitely use Asphyre if the target is Windows only. It has quite active forum and many examples (though many are for older versions). Latest edition can also directly use Imaging for loading images. 


Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Name:
Email:

Shortcuts: ALT+S save/post or ALT+P preview

SMF spam blocked by CleanTalk