[fpc-pascal] Loading PNG files as OpenGL textures

Ryan Joseph ryan at thealchemistguild.com
Thu Oct 15 10:30:41 CEST 2015


> On Oct 14, 2015, at 1:49 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
> 
> Type
> TMyImage = Class(TFPCompactImgRGBA8Bit)
> Public
>  property Data :  PFPCompactImgRGBA8BitValue read FData;
> end;
> 
> 
> Should do it. Or if you don't need Alpha:
> 
> TMyImage = Class(TFPCompactImgRGB8Bit)
> Public
>  property Data :  PFPCompactImgRGB8BitValue read FData;
> end;
> 
> You could throw in a property to get a direct pointer

TFPCompactImgRGBA8Bit descends from TFPMemoryImage I assume? I need to draw text as textures also and I found an example at http://wiki.freepascal.org/fcl-image#Drawing_text which uses TFPMemoryImage.

Thanks for the example, I’ll give this a try.


Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list