Example #1
0
File: test.c Project: xpol/egg
// xxx.pvr RGB565:wxh (x,y,0xRRGGBBAA)
int main(int argc, char *argv[])
{
	EGGImage image = EGG_INVALID_HANDLE;
	int i;
	if (argc < 2)
		goto fail;

	image = loadPVR(argv[1]);
	if (image == EGG_INVALID_HANDLE)
		goto fail;

	if (argc > 2 && !verifyImage(image, argv[2]))
		goto fail;
	
	for (i = 3; i < argc; i++)
	{
		if (!verifyColor(image, argv[i]))
			goto fail;
	}

	eggDestroyImage(image);
	return EXIT_SUCCESS;
fail:
	eggDestroyImage(image);
	return EXIT_FAILURE;
}
Example #2
0
void Texture::load(DataBuffer *dataBuffer) {
	char ext[ MAX_CHAR ] = {""};
	Utils::getFileName(dataBuffer->getFilename(), this->name);

	Utils::getFileExtension(dataBuffer->getFilename(), ext, 1);

	if(!strcmp(ext, "PNG"))
		loadPNG(dataBuffer);
	else if(!strcmp(ext, "PVR"))
		loadPVR(dataBuffer);
}