[fpc-pascal] Loading PNG files as OpenGL textures

Ryan Joseph ryan at thealchemistguild.com
Wed Oct 14 03:31:27 CEST 2015


> On Oct 12, 2015, at 2:25 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
> 
> TFPCustomImage is an abstract image class, it provides no storage for the data. It can have several descendants such as TFPMemoryImage and TFPCompactImgRGBA8Bit.
> If you just want the raw data, create a TFPMemoryImage and access the Colors array property.

Sorry for the silence.

I’ve learned that the FPImage classes are pretty slow but I’d like to try them anyways first to see if they’re acceptable.

I don’t use Delphi so the FPC docs are a little confusing for me. There is a colors/pixels property but from what I can tell they map to getting a single pixel/color at a specific location, but the docs aren’t clear because the method arguments are never shown. 

Do I need to loop through all the pixels or something and pack them into a pointer? There should be some a single continuous block of memory in this class but I can’t seem to find it using the colors/pixels property. What am I missing?

==========

http://lazarus-ccr.sourceforge.net/docs/fcl/fpimage/tfpmemoryimage.html
http://lazarus-ccr.sourceforge.net/docs/fcl/fpimage/tfpcustomimage.html


Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list