A set of small introductory programs.
It's about the window, the window icon and surfaces.
0 - init video, events and create Window
9 - candy bar | press 's' for screenshot
11 - copper bars | press 's' for screenshot
Creating a screenshot from a surface is as simple as:
SDL_SaveBMP(surface, "name.png");
SDL2 | SDL-Discourse | My Example Code
http://demo-effects.sourceforge.net/
make
- builds all
make $target
- builds target
make -j $(nproc)
uses all cores to build faster
Pushing around bytes per pixel, casting pointers this way, is not a good practice to write cross platform code.
Here the size of unsigned int
is 4 bytes which aligns with the bytes per pixel on my machine.
This stuff is pretty low level and flipping bits on software surfaces is insane nowadays, but this is in preparation to my 'Pixel-Access' series, which is in turn a preparation for my 'GLSL for C-Coders' series.