   [MAYA] Loading textures with OpenGL
  Hey,while I was playing with the Maya 7 C++ API, I tried to load a texture on a reactangle.It didn't work! That was a bit of a surprise to me because i just copied the source to load a texture from NEHE (why code it yourself if it has already been done ;)).Now I'm wondering... is it possible to load a texture via OpenGL in maya?Thnxps: I'm making a locator.pps: This is my source:Draw function of my locatorview.beginGL();glPushAttrib(GL_CURRENT_BIT);glBindTexture(GL_TEXTURE_2D, texture);glBegin(GL_QUADS);glVertex3f(-100.0f, 100.0f, 0.0f);glVertex3f( 100.0f, 100.0f, 0.0f);glVertex3f( 100.0f,-100.0f, 0.0f);glVertex3f(-100.0f,-100.0f, 0.0f);glEnd();glPopAttrib();view.endGL();Init function:texture = loadTexture("texture.bmp"); // This is just a function to load a BMP file.return MStatus::kSuccess;loadTexture function:if ( image ){glGenTextures(1, &texture);glBindTexture(GL_TEXTURE_2D, texture);glTexImage2D(GL_TEXTURE_2D, 0, 3, image->sizeX, image->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, image->data);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);if (image->data)free(image->data);free(image);return texture;}