view test/testver.c @ 1543:98f9b16f565c

From: "Alex Volkov" Date: Thu, 10 Nov 2005 21:53:40 -0500 Subject: [SDL] BUG[?]: 32bpp RGBA->RGB colorkey blit, no SDL_SRCALPHA It seems there is either a documentation vs. reality mismatch or a real bug in SDL_blit_N.c:BlitNtoNKey(). The exact blit in question is a 32bpp RGBA->RGB, where RGBA has SDL_COLORKEY and *no* SDL_SRCALPHA flags. The doc in SDL_video.h states: * RGBA->RGB: * SDL_SRCALPHA not set: * copy RGB. * if SDL_SRCCOLORKEY set, only copy the pixels matching the * RGB values of the source colour key, ignoring alpha in the * comparison. BlitNtoNKey(), however, forgets to "ignore alpha in the comparison". The documentation makes perfect sense, so I think it is the code that is faulty. The attached patch corrects the code.
author Sam Lantinga <slouken@libsdl.org>
date Wed, 15 Mar 2006 15:43:15 +0000
parents d93862a3d821
children 782fd950bd46 c121d94672cb
line wrap: on
line source


/* Test program to compare the compile-time version of SDL with the linked
   version of SDL
*/

#include <stdio.h>
#include <stdlib.h>

#include "SDL.h"

int main(int argc, char *argv[])
{
	SDL_version compiled;

	/* Initialize SDL */
	if ( SDL_Init(0) < 0 ) {
		fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
		exit(1);
	}
#ifdef DEBUG
	fprintf(stderr, "SDL initialized\n");
#endif
#if SDL_VERSION_ATLEAST(1, 2, 0)
	printf("Compiled with SDL 1.2 or newer\n");
#else
	printf("Compiled with SDL older than 1.2\n");
#endif
	SDL_VERSION(&compiled);
	printf("Compiled version: %d.%d.%d\n",
			compiled.major, compiled.minor, compiled.patch);
	printf("Linked version: %d.%d.%d\n",
			SDL_Linked_Version()->major,
			SDL_Linked_Version()->minor,
			SDL_Linked_Version()->patch);
	SDL_Quit();
	return(0);
}