Пример #1
0
void
demoUnload()
{
	xlImgDeleteTexture();
	xlImgUnload();
	xlBindImage(img[1]);
	xlImgUnload();
	xlBindImage(img[2]);
	xlImgUnload();
	xlDeleteImages(3, img);
}
Пример #2
0
void
demoKeyboard(unsigned char key, int x, int y)
{
	switch(key)
	{
		case 'l':
		{
			XLstring strtmp;

			if(!edit) { str[0] = L'\0'; edit = XL_TRUE; }
			xlStringCopy(strtmp, str);
			xlStringPrintFormatted(str, XL_STRING_SIZE, L"%ls%c", strtmp, key);
			xlBindImage(img[0]);
			xlImgDeleteTexture();
			xlImgUnload();
			xlImgImport("data/images/Tux.png");
			xlImgGenTexture();
			break;
		}
		case '\r':
			edit = XL_FALSE;
			xlStringPrintFormatted(str, XL_STRING_SIZE, L"%ls", xlName);
			xlBindImage(img[0]);
			xlImgDeleteTexture();
			xlImgUnload();
			myImgString();
			xlImgGenTexture();
			break;
		default:
		{
			XLstring strtmp;

			if(!edit) { str[0] = L'\0'; edit = XL_TRUE; }
			xlStringCopy(strtmp, str);
			xlStringPrintFormatted(str, XL_STRING_SIZE, L"%ls%c", strtmp, key);
			xlBindImage(img[0]);
			xlImgDeleteTexture();
			xlImgUnload();
			myImgString();
			xlImgGenTexture();
			break;
		}
	}
}
Пример #3
0
void
xlMatDeleteTextures(void)
{
    XLmaterial *bind = xlGetMaterial();
    XLuint i;

    for(i = 0; i < bind->header.properties; i++)
    {
        xlBindImage(bind->runtime.images[i]);
        xlImgDeleteTexture();
    }
}
Пример #4
0
void
demoLoad(int *argc, char **argv)
{
	if(*argc < 2) xlStringCopy(str, xlName);
	else xlStringPrintFormatted(str, XL_STRING_SIZE, L"%s", argv[1]);
	edit = XL_FALSE;

	xlGenImages(3, img);
	xlBindImage(img[2]);
	image[2] = xlGetImage();
	xlDataLoad("data/images/Grass.xlc");
	xlImgScale(size[0], size[1]);
	xlBindImage(img[1]);
	image[1] = xlGetImage();
	xlDataLoad("data/images/Textil.xlc");
	xlImgScale(size[0], size[1]);
	xlBindImage(img[0]);
	image[0] = xlGetImage();
	myImgString();
	//xlImgExport("String.png");
	xlImgGenTexture();
}