[fpc-pascal] Loading PNG files as OpenGL textures

Ryan Joseph ryan at thealchemistguild.com
Mon Oct 12 02:21:12 CEST 2015


> On Oct 11, 2015, at 10:45 PM, Graeme Geldenhuys <mailinglists at geldenhuys.co.uk> wrote:
> 
> As Michael mentioned, fpimage and fpreadpng can do this. Here is how I
> use it to populate fpGUI's TfpgImage class with image data.
> 
> https://github.com/graemeg/fpGUI/blob/develop/src/corelib/fpg_imgfmt_png.pas

But can I then access the pixel data so I can hand it to glTexImage2D and make the texture? I think the FPC RTL classes on http://wiki.freepascal.org/fcl-image would do this also but again it’s not clear how to get the pixel data for glTexImage2D

Thanks.

Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list