kota's memex

image compression

https://studios.ptilouk.net/superfluous-returnz/blog/2022-09-28_compression.html

common mistakes

https://nullprogram.com/blog/2023/01/08/

hello world

#include <stdlib.h>

#include "SDL_video.h"
#include "SDL.h"
#include "SDL_error.h"

const int SCREEN_WIDTH	= 640;
const int SCREEN_HEIGHT = 480;

int main(void) {
	SDL_Window* window	 = NULL;
	SDL_Surface* screen	 = NULL;

	if (SDL_Init(SDL_INIT_VIDEO) < 0) {
		fprintf(stderr, "Unable to initialize SDL: %s\n", SDL_GetError());
		return EXIT_FAILURE;
	}

	window = SDL_CreateWindow(
		"SDL Hello World",
		SDL_WINDOWPOS_UNDEFINED,
		SDL_WINDOWPOS_UNDEFINED,
		SCREEN_WIDTH,
		SCREEN_HEIGHT,
		SDL_WINDOW_SHOWN);
	if (window == NULL) {
		fprintf(stderr, "Unable to create window: %s\n", SDL_GetError());
		return EXIT_FAILURE;
	}

	screen = SDL_GetWindowSurface(window);
	SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 0xFF, 0xFF, 0xFF));
	SDL_UpdateWindowSurface(window);
	SDL_Delay(2000);
	SDL_DestroyWindow(window);
	SDL_Quit();
	return EXIT_SUCCESS;
}