[fpc-pascal] Loading PNG files as OpenGL textures

Michael Van Canneyt michael at freepascal.org
Mon Oct 12 09:34:14 CEST 2015



On Mon, 12 Oct 2015, Anthony Walter wrote:

> Michael,
>
> I've written a whole lot of OpenGL demos (demoscene) using both C and
> Pascal. I can tell you there is a huge difference between the Delphi image
> decompression performance and the performance of the image libs ones
> provided by the OS (WIC and Quartz especially). The OS imaging libs are
> orders of magnitudes faster than TFPImage, especially when it comes to
> loading 100s of textures during the start of a demo or game. Speed aside,
> all the OS imaging libs also provide vastly superior image manipulation
> including scaling, blending, and all support matrix color operations on
> pixels.

As I said: performance is the only reason IMHO.
If all you need to do is load an image to display it somewhere, 
then your method is complete overkill and not worth the hassle.

And everyone is reinventing the wheel anyway, every gaming library 
I've encountered out there reinvents all the image routines, be it 
as wrappers or native.

The main reason TFPImage exists is to be free of external dependencies.

Michael.



More information about the fpc-pascal mailing list