This is very similar to my other post regarding font glyph rendering.
So, with Delphi on Windows, I used DelphiStb (
https://github.com/neslib/DelphiStb) to load images from disk to memory buffers that I could then use with OpenGL. There doesn't seem to be an equivalent or similar library/binding that works with FPC on Linux.
I'd really like to avoid having to create a TBitmap or other object/component, have it load the image, then grab the data from it to stick into another memory buffer. I'm looking for something that will just read the image from disk and shove that raw pixel data right into a memory buffer.
I went as far as writing my own functions for various types of bitmaps and PNG, but I'd also like to not have to keep dealing with edge cases or continuing to have to learn how to decompress more image formats to make the code more practical.
Things, like SFML and SLD2 exist, but I'm also going to be using my own Windowing and OpenGL code, and I'd like to be able to just load the image directly into memory where I can do with it what I please from there, instead of having to incur the overhead or abstractions of those other libraries/frameworks.
Edit: it turns out that creating the shared object library for the stb headers I wanted and then altering the Neslib.Stb units to load the library was extremely painless, though considering that the last commit on the Neslib repo was 8 years, ago, I could scan over the latest stb headers to see what needs to be added or changed. I'll end up either uploading the shared object library and the units to my own repo, or see if I can't get get the changes merged to the original Neslib repo.