Original Post
I'm writing a 2D graphics library with C++ and OpenGL. It needs to load PNG files into the RAM (as pixel rectangles) before it loads them to the GPU as texture objects. Since I have no knowledge in the fields of compression and dynamic linking, I decided to try an existing library. I found libpng. It does exactly what I need. The problem is that the documentation is a disaster. And it's written in C. Using C versions of libraries I'm already using in C++ wastes memory (bigger EXE file) and I'm not familiar with most of the functions that are used there since I only use their C++ equivalents. After downloading zlib, which is used by libpng, I downloaded png++, which can read a PNG file using one simple function. I wrote a simple C++ program that loads a PNG file and draws it on the screen, but it didn't work. After coying and pasting source files and replacing some include <..> with include "..." , all libraries could be read, but there was a new problem: compilation errors in the libraries. png++ is written for g++ while I'm using Visual C++ so maybe this is why there are errors. Anyway, does anyone know a simple method to load a 32-bit RGBA PNG file into the memory as a block of pixels? Anything would help. Especially a simple example that uses png++ (with Visual C++) and simply reads a RGBA PNG file into the memory (and then loads it to the GPU). A simple explanation will help too. :)