3
#include <SDL/SDL_image.h>
5
#include <emscripten.h>
9
int testImage(const char* fileName) {
10
SDL_Surface *image = IMG_Load(fileName);
13
printf("IMG_Load: %s\n", IMG_GetError());
16
assert(image->format->BitsPerPixel == 32);
17
assert(image->format->BytesPerPixel == 4);
18
assert(image->pitch == 4*image->w);
19
int result = image->w;
21
SDL_BlitSurface (image, NULL, screen, NULL);
22
SDL_FreeSurface (image);
30
testImage("screenshot.jpg"); // relative path
36
SDL_Init(SDL_INIT_VIDEO);
37
screen = SDL_SetVideoMode(600, 450, 32, SDL_SWSURFACE);
41
rename("screenshot.not", "screenshot.jpg");