[fpc-pascal] Loading PNG files as OpenGL textures

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Mon Oct 12 12:37:24 CEST 2015


On 2015-10-12 01:21, Ryan Joseph wrote:
> But can I then access the pixel data so I can hand it to glTexImage2D and make the texture? 

Yes, look at line 61. Simply use the Colors[] array property.

The code I suggested was not meant as a complete implementation for you,
but as an example of how to use the fpImage and FPReadPNG units. Like I
said, once the PNG file is loaded, use the Colors[] array property to
access the pixel data.

Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp



More information about the fpc-pascal mailing list