Historique des modifications - Message

Message #3694

Sujet: deplacer fenetre


Type Date Auteur Contenu
Dernière modification 15-03-2008 22:47:17 dark 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 message 15-03-2008 22:46:12 dark 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

Options Liens officiels Caractéristiques Statistiques Communauté
Préférences cookies
Corrections
irrlicht
irrklang
irredit
irrxml
Propulsé par Django
xhtml 1.0
css 2.1
884 membres
1440 sujets
11337 messages
Dernier membre inscrit: Saidov17
118 invités en ligne
membre en ligne: -
RSS Feed