[fpc-pascal] Loading PNG files as OpenGL textures

Ryan Joseph ryan at thealchemistguild.com
Sun Oct 11 11:36:56 CEST 2015


> On Oct 11, 2015, at 1:53 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
> 
> You can use the fpimage and fpreadpng units. Check the packages/fcl-image sources. There is a small demo program that shows how to do it.

I see you can load an image as TFPCustomImage with TFPCustomImageReader then there is a canvas class (TFPCustomCanvas) which I assume I could draw the TFPCustomImage into and expose the pixels as a pointer to memory which I could then use to make the OpenGL texture.

I’m not able to see the references for TFPCustomCanvas in particular so I’m not sure how this would work. There is the guide I found but is there any more complete examples I could look at? Too much is missing to understand exactly how all these classes work together. 

http://wiki.freepascal.org/fcl-image

Thanks.


Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list