aurelivs
Messages postés11Date d'inscriptionsamedi 27 mars 2004StatutMembreDernière intervention11 septembre 2005
-
10 sept. 2005 à 22:25
aurelivs
Messages postés11Date d'inscriptionsamedi 27 mars 2004StatutMembreDernière intervention11 septembre 2005
-
11 sept. 2005 à 14:04
bonjour
je cherche a faire une appli en C++ et OpenGL pour charger une image et afficher cette image (puis la transformer). cependant je n'arrive pas à l'afficher (j'ai un blanc à la place). je crois que c'est en rapport avec la taille de l'image . en 256*256 elle passe sans problème. par contre dès qu'on augmente la taille ca pose problème.
quelque'un pourrait m'aider a ce sujet? merci.
voici le code correspondant :
if (TextureImage[0]=LoadBMP("Data/greentext_768.bmp"))
{
Status=TRUE; // Set The Status To TRUE
glGenTextures(1, &texture[0]); // Create The Texture
Typical Texture Generation Using Data From The Bitmap
glBindTexture(GL_TEXTURE_2D, texture[0]);
glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
}
..........
int InitGL(GLvoid) // All Setup For OpenGL Goes Here
{
if (!LoadGLTextures()) // Jump To Texture Loading Routine ( NEW )
{
return FALSE; // If Texture Didn't Load Return FALSE
}
glEnable(GL_TEXTURE_2D); // Enable Texture Mapping ( NEW )
glShadeModel(GL_SMOOTH); // Enable Smooth Shading
glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background
glClearDepth(1.0f); // Depth Buffer Setup
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really Nice Perspective Calculations
return TRUE; // Initialization Went OK
}
aurelivs
Messages postés11Date d'inscriptionsamedi 27 mars 2004StatutMembreDernière intervention11 septembre 2005 11 sept. 2005 à 14:04
voila. par exemple, si je charge une image 1024*1024, l'image ne s'affiche plus, un blanc apparaît à la place. si t'as un début de réponse, ca m'aiderait .