All pastes #930773 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-03-06 20:41 UTC
rendered paste body
#include <png.h>
#include <allegro.h>
#include <loadpng.h>
#include <cstdio>

int main(void)
{
	allegro_init();
	install_keyboard();

	set_color_depth(16);
	if (set_gfx_mode(GFX_AUTODETECT_WINDOWED, 720, 480, 0, 0)) {
		printf("Failed to set graphics mode\n");
		return 1;
	}

	register_png_file_type();

	BITMAP *test = load_bitmap("test.png", 0);
	if (!test) {
		printf("couldn't load test.png\n");
		return 1;
	}

	blit(test, screen, 0, 0, 0, 0, 20, 20);
	readkey();
}
END_OF_MAIN()