return;

Getting started with C programming - More -

Drawing text

There's 3 approaches to drawing text:

Unfortunately I don't know of any pre-made text rendering libraries, it's not too hard to make one yourself using one of the methods above, but it might be tedious if you don't care about that kind of thing.

Rendering methods

There's 2 main ways to put graphics onto the screen: write pixels into a canvas and tell the OS to show it on your window, or use a graphics API (which basically does the same but more efficiently on the GPU and hidden from you) with shaders. Rendering libraries usually use a graphics API.

Images/audio without libraries

Reading a file format like PNG requires you to learn the PNG format which is quite extensive, and possibly learn compression algorithms and implement them yourself. It might be useful for learning more programming skills, but otherwise I think it's a waste of time because you can't really do anything with it. The goal is to read a format that someone else designed so there isn't a lot of room for creativity.

If you want to load an image without libraries, BMP is your friend. There's a few different versions and settings in them, but as long as you don't need full-featured BMP support, they're very easy to read because the pixel data is just in there up for taking. You may need to swap some colors around but that's it.

The process goes something like this: Check what BMP version is used. Read integers for width, height and position of the pixel data, all of them are at pre-defined positions in the file. Skip to the pixel data and read the pixels. Depending on version, there may also be pixel masks that determine how the colors in the pixels are ordered (e.g. RGBA vs BGRA). You can read a BMP in less than 10 lines of code if you don't care about validating everything or supporting the different versions or uncommon settings.

If you want to load a sound without libraries, WAV is your friend. WAV is similar to BMP except for audio: there's some settings that may complicate it, but usually the sound data is just sitting in there so all you need to do is figure out where it's at and then read it.

The proces of reading WAV is slightly more complicated, you need to loop through "chunks", each containing different kind of information, until you find the chunk that has the audio data. You can just skip the chunk types that you don't care about, but there's another chunk that has information about the audio data which you'll want, like how many channels it has (usually 2, for left and right) and how fast you're supposed to play the sound data (Hz). Reading a basic WAV file takes less than 150 lines of code.

The downside of BMP and WAV is that they are not compressed, so the filesize is HUGE compared to compressed formats. There's also an upside though, which is that they're much faster to load into your program since your CPU doesn't have to spend any time uncompressing them.