/*
- Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
/* Load the sprite image */
temp = SDL_LoadBMP(file);
if (temp == NULL) {
- SDLTest_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", file, SDL_GetError());
+ SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", file, SDL_GetError());
return NULL;
}
/* Create textures from the image */
texture = SDL_CreateTextureFromSurface(renderer, temp);
if (!texture) {
- SDLTest_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError());
+ SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError());
SDL_FreeSurface(temp);
return NULL;
}
SDL_RenderCopy(s->renderer, A, NULL, NULL);
SDL_RenderReadPixels(s->renderer, NULL, SDL_PIXELFORMAT_ARGB8888, &P, sizeof(P));
- SDLTest_Log("Blended pixel: 0x%8.8X\n", P);
+ SDL_Log("Blended pixel: 0x%8.8X\n", P);
SDL_DestroyTexture(A);
SDL_DestroyTexture(B);
target = SDL_CreateTexture(s->renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_TARGET, viewport.w, viewport.h);
if (!target) {
- SDLTest_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create render target texture: %s\n", SDL_GetError());
+ SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create render target texture: %s\n", SDL_GetError());
return SDL_FALSE;
}
SDL_SetRenderTarget(s->renderer, target);
}
#endif
}
-#ifdef main
-#undef main
-#endif
+
int
-SDL_main(int argc, char *argv[])
+main(int argc, char *argv[])
{
int i;
int frames;
}
}
if (consumed < 0) {
- SDLTest_Log("Usage: %s %s [--composite]\n",
+ SDL_Log("Usage: %s %s [--composite]\n",
argv[0], SDLTest_CommonUsage(state));
quit(1);
}
now = SDL_GetTicks();
if (now > then) {
double fps = ((double) frames * 1000) / (now - then);
- SDLTest_Log("%2.2f frames per second\n", fps);
+ SDL_Log("%2.2f frames per second\n", fps);
}
SDL_stack_free(drawstates);