Opengl et DevIL

Résolu
xarier Messages postés 688 Date d'inscription jeudi 26 décembre 2002 Statut Membre Dernière intervention 19 mai 2005 - 20 avril 2004 à 12:04
xarier Messages postés 688 Date d'inscription jeudi 26 décembre 2002 Statut Membre Dernière intervention 19 mai 2005 - 14 juil. 2004 à 16:17
Hi everybody ma questipon est la suivante:
comment faire ca avec devil [ pour le dernier parametre ]

glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);

Xarier@hotmail.com
http://www.membres.lycos.fr/dev3d/

10 réponses

cs_djl Messages postés 3011 Date d'inscription jeudi 26 septembre 2002 Statut Membre Dernière intervention 27 novembre 2004 7
20 avril 2004 à 21:36
ILubyte *Data;

Data=ilGetData();

glTexImage2D( ..., Data);
3
xarier Messages postés 688 Date d'inscription jeudi 26 décembre 2002 Statut Membre Dernière intervention 19 mai 2005
14 juil. 2004 à 01:48
Re : alors commenca ta 2 c bien :)
Life is Short 8-)
0
cs_djl Messages postés 3011 Date d'inscription jeudi 26 septembre 2002 Statut Membre Dernière intervention 27 novembre 2004 7
14 juil. 2004 à 09:45
c'est quoi 2 ?
0
xarier Messages postés 688 Date d'inscription jeudi 26 décembre 2002 Statut Membre Dernière intervention 19 mai 2005
14 juil. 2004 à 13:21
pardon je voulait ecrire commencata 20 ans c bien :)
oki
autre chose j'ai un prob avec devil

gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB, ilGetInteger(IL_IMAGE_WIDTH), ilGetInteger(IL_IMAGE_HEIGHT), GL_RGB, GL_UNSIGNED_BYTE, ilGetData());

bne il me donne une erreur qui dit impossible memoire read je c plus alors please si tu peut allumez msn ouje c rien car la je c plus koi faire :(
Merci
Life is Short 8-)
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
cs_djl Messages postés 3011 Date d'inscription jeudi 26 septembre 2002 Statut Membre Dernière intervention 27 novembre 2004 7
14 juil. 2004 à 13:30
ok, tu peux donner le code complet du chargement de l'image stp
0
xarier Messages postés 688 Date d'inscription jeudi 26 décembre 2002 Statut Membre Dernière intervention 19 mai 2005
14 juil. 2004 à 13:57
ben en faite l'erreur vien de GL_UNSIGNED_BYTE quand je met 0 ca marche mais c pas normal et pour le code voila :

GLuint TexID[MAX_TEXTURE];
GLuint ImgId[MAX_TEXTURE];

GLvoid CTexture::LoadTexture(GLuint ID,char * FILENAME)
{

ilGenImages(1, &ImgId[ID]);
// Utiliser le nom creé
ilBindImage(ImgId[ID]);
// Charger l'image definie par FILENAME dans l'image ImgId.
ilLoadImage(FILENAME);
TexID[ID] = ilutGLBindTexImage();
glBindTexture(GL_TEXTURE_2D, TexID[ID]);

// select modulate to mix texture with color for shading
glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );

// when texture area is small, bilinear filter the closest mipmap
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST );
// when texture area is large, bilinear filter the original
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );

// the texture wraps over at the edges (repeat)
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );

gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB, ilGetInteger(IL_IMAGE_WIDTH), ilGetInteger(IL_IMAGE_HEIGHT), GL_RGB, GL_UNSIGNED_BYTE,ilGetData());

}

Life is Short 8-)
0
cs_djl Messages postés 3011 Date d'inscription jeudi 26 septembre 2002 Statut Membre Dernière intervention 27 novembre 2004 7
14 juil. 2004 à 15:58
je vois pas
mais pour charger une image jpeg je me sert de ce code et ca marche sans pb

ILubyte *Data;

ilInit();
iluInit();
ilutRenderer(ILUT_OPENGL);
ilutEnable(ILUT_OPENGL_CONV);

ilLoadImage((char * const)image.path.c_str());

image.width=ilGetInteger(IL_IMAGE_WIDTH);
image.height=ilGetInteger(IL_IMAGE_HEIGHT);
Data = ilGetData();

image.id=ilutGLBindTexImage();

glBindTexture(GL_TEXTURE_2D,image.id);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 2.0f);
glTexParameteri (GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri (GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);

gluBuild2DMipmaps(GL_TEXTURE_2D, 3, image.width, image.height,
GL_RGB, GL_UNSIGNED_BYTE, Data);
0
xarier Messages postés 688 Date d'inscription jeudi 26 décembre 2002 Statut Membre Dernière intervention 19 mai 2005
14 juil. 2004 à 16:03
ben c koi au juste ilutEnable(ILUT_OPENGL_CONV); car moi je ne la met pas est ca marche secondo va voir dans le forum la un titre au il ya ecrie openg lc c la suite de ca car j'ai trouver d'ou ca vient le prob mais c as normal OKi
se e YOU
Life is Short 8-)
0
cs_djl Messages postés 3011 Date d'inscription jeudi 26 septembre 2002 Statut Membre Dernière intervention 27 novembre 2004 7
14 juil. 2004 à 16:15
c'est juste conseillé pour les cg nvidia, mais c'est as de la que peut venir le probleme
0
xarier Messages postés 688 Date d'inscription jeudi 26 décembre 2002 Statut Membre Dernière intervention 19 mai 2005
14 juil. 2004 à 16:17
oki Merci
Life is Short 8-)
0
Rejoignez-nous