Does anyone know of a pure Pascal PNG library that works on Win32, Linux and MacOS X? I could go down the route of using libpng, but that requires shipping it with ones game/app which means compiling for each OS/Platform.
Any suggestions/ideas?
Does anyone know of a pure Pascal PNG library that works on Win32, Linux and MacOS X? I could go down the route of using libpng, but that requires shipping it with ones game/app which means compiling for each OS/Platform.
Any suggestions/ideas?
Any pascal implementation of png using paszlib should work fine on any platform...
This is my game project - Top Down City:
http://www.pascalgamedevelopment.com...y-Topic-Reboot
My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
http://www.pascalgamedevelopment.com...source+manager
I think I may have found a pure pascal implemation here - http://www.colosseumbuilders.com/sourcecode.htm
Will need to test it before I give it the thumbs up.
what about http://pngdelphi.sourceforge.net/ ?
It even works without Delphi VCL, which would be a great portability point and make it useful for games. the only problem is, that it uses delphi's zlib OBJ files, which efficiently bind it to delphi-only, but making it use PasZlib shouldn't be a problem imo - just replace PNGZLIB.PAS with another unit, that will use paszlib.
This is my game project - Top Down City:
http://www.pascalgamedevelopment.com...y-Topic-Reboot
My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
http://www.pascalgamedevelopment.com...source+manager
I'm currently using pngdelphi on win32 and it does work very well, but since it uses the *.o is why I was looking for an alternative.
Paszlib looks very good, but has not been updated in ages. So that would require that I update it to the very latest version of zlib.
Lastly, the colosseumbuilders pascal implementation seems to work partially, or at least seems to be partial as the rendering example that is ships with does not display the toucan image correctly. So that looks like it may need updating as well.
So all in all, at the moment, any way I go, I need to get my hands dirty. Now which path will be the least hassle and will benefit the most people?
I'd say getting pngdelphi to work with paszlib would be better, it has better loader and alpha support, paszlib may be "a little" old, but still works great.
This is my game project - Top Down City:
http://www.pascalgamedevelopment.com...y-Topic-Reboot
My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
http://www.pascalgamedevelopment.com...source+manager
Strangely, this is exactly what I was thinking, and after about 7 minutes of replacing, TPngImage seems to work quite well with PasZlib. It's a pity it has not been updated, just to keep it current if for nothing else.Originally Posted by Delfi
A few months ago I asked myself the same question.
Lazarus comes with PNG support. LoadPNG().
Marmin^.Style
That's not useful outside of lazarus - such as kylix and delphi, also, does it support alpha channels?Originally Posted by marmin
This is my game project - Top Down City:
http://www.pascalgamedevelopment.com...y-Topic-Reboot
My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
http://www.pascalgamedevelopment.com...source+manager
Since you want it to work on Win32, Linux and MacOS X, you're clearly looking for a Free Pascal solution, so Kylix and Delphi support is irrelevant. Doesn't Free Pascal support PNG with the fpimage unit? I haven't tried it outside of compiling and running the associated demo program (see imgconv.pp), but it seems to support transparency as far as I can tell. Also, as far as I can tell it doesn't require libpng, but correct me if I'm wrong. It's part of the FCL, which is poorly documented. You'll have to look at the source code to see what it can do. It's in the fcl/image sub-directory.
[size=10px]"In science one tries to tell people, in such a way as to be understood by everyone, something that no one ever knew before. But in poetry, it's the exact opposite." -- Paul Dirac[/size]
Bookmarks