Open spartrekus opened 6 years ago
Not sure what you mean? This library doesn't depend on SDL nor openGL, and can be compiled with a plain C compiler.
Yep, it does support plain C90. There is an ifdef for C++ and for C in the same file, you can rename the .cpp to .c. It is just integrated all in one source file to keep it a single file library :)
The good thing would be that there is X11 (without SDL or Opengl). Just show a picture using the basic Xorg X11 library.
The core library itself is purely a "convert one byte stream to other byte stream" encoder/decoder, which doesn't interface with other libraries like graphics renderers. Adding such dependencies, even optional, is out of scope for this library.
An example, like the SDL example, might work. It would be more an example showing how to draw pixels in X11 than it is about PNG, but the SDL example is like that too of course. A contribution of such an example similar to the SDL one is welcome.
The problem is that since sdl 2.0 and higher versions, the graphical applications may run slow on many hardwares.
Really x11 is surely not very fancy, beautiful, but it is just working (reliable).
Well but the SDL example is just an example, if you want fast rendering it's better to use a good rendering engine anyway (SDL seems fast to me by the way, at least when I used it in the 1.2 era). Like, if X11 suits your needs, why not that one indeed.
In a real world application where speed matters, I assume you want to do more than just display a single PNG image in a window that closes as soon as you press any key, so there will be more work needed anyway than what a simple example in a PNG decoding library can give.
Groetjes,
The cool thing would be to avoid SDL and OPENGL for LODEPNG, as well C++ (g++, cmake,...).
Would it be possible to give a LODEPNG for X11 and plain C (if possible, lot of work I know,...)?
thank you for your efforts creating light libraries for everyone and every usable applications !!!