Historique des modifications - Message

Message #3694

Sujet: deplacer fenetre


TypeDateAuteurContenu
Dernière modification15-03-2008 22:47:17dark calculator
rebonjour

voila j'ai fait ma petite routine qui a l'air de marcher pour une texture classique en revanche je sais pas comment faire pour une texture rendertotarget car lock renvoie 0.
int flip(ITexture* tex)
{
	char* buf = (char*) tex->lock();
	if (buf==0)
		printf("probleme\
");
	int tp = 0;
	switch (tex->getColorFormat())
	{
		case ECF_A1R5G5B5	: tp = 2;
		case ECF_R5G6B5		: tp = 2;
		case ECF_R8G8B8		: tp = 3;
		case ECF_A8R8G8B8	: tp = 4;
	}
	int size = tex->getSize().Height * tex->getSize().Width * tp;
	char *temp = new char [size];
	for (int i=0;i<size;i++)
		temp[i] = buf[i];
	for (int i=0;i<tex->getSize().Width;i++)
		for (int j=0;j<tex->getSize().Height;j++)
			memcpy(buf + i*tp+j*tex->getSize().Width*tp, temp + i*tp+(tex->getSize().Height-j)*tp*tex->getSize().Width, tp);
	tex->unlock();
}

Donc si quelqu'un a une idée qu'il fasse signe.
Si j'ai le temps je metterait la routine dans la wiki

dark calculator
Création du message15-03-2008 22:46:12dark calculator
rebonjour

voila j'ai fait ma petite routine qui a l'air de marcher pour une texture classique en revanche je sais pas comment faire pour une texture rendertotarget car lock renvoie 0.
int flip(ITexture* tex)
{
	char* buf = (char*) tex->lock();
	if (buf==0)
		printf("probleme\
");
	int tp = 0;
	switch (tex->getColorFormat())
	{
		case ECF_A1R5G5B5	: tp = 2;
		case ECF_R5G6B5		: tp = 2;
		case ECF_R8G8B8		: tp = 3;
		case ECF_A8R8G8B8	: tp = 4;
	}
	int size = tex->getSize().Height * tex->getSize().Width * tp;
	char *temp = new char [size];
	for (int i=0;i<size;i++)
		temp[i] = buf[i];
	for (int i=0;i<tex->getSize().Width;i++)
		for (int j=0;j<tex->getSize().Height;j++)
			memcpy(buf + i*tp+j*tex->getSize().Width*tp, temp + i*tp+(tex->getSize().Height-j)*tp*tex->getSize().Width, tp);
	tex->unlock();
}

Donc si quelqu'un a une idée qu'il fasse signe.
Si j'ai le temps je metterait la routine dans la wiki

dark calculator

Retour

OptionsLiens officielsCaractéristiquesStatistiquesCommunauté
Préférences cookies
Corrections
irrlicht
irrklang
irredit
irrxml
Propulsé par Django
xhtml 1.0
css 2.1
884 membres
1441 sujets
11339 messages
Dernier membre inscrit: Saidov17
328 invités en ligne
membre en ligne: -
RSS Feed