Problem:Instead of displaying a texture, it displays a white quad.
Description of Problem:I'm trying to display a simple texture onto a simple 2D square. Unfortunately, I seem to be having a great deal of difficulty and I'm not quite sure why. What I'm doing is using sf::Image and then taking the data and turning it into a OpenGL texture. The drawing goes perfectly and it displays a rectangle properly, however, my problem is that rather than displaying the texture I've specified, it displays white.
Code for loading the texture and converting it is here:sf::Image Image;
if (!Image.loadFromFile(path)) {
printf("An error occurred in loading the texture.");
}
glGenTextures(1, &FinalTexture);
glBindTexture(GL_TEXTURE_2D, FinalTexture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, Image.getSize().x, Image.getSize().y, 0, GL_RGB, GL_UNSIGNED_BYTE, Image.getPixelsPtr());
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glBindTexture(GL_TEXTURE_2D, 0);
FinalTexture is defined as:GLuint FinalTexture;
Method of binding & drawingglBindTexture(GL_TEXTURE_2D, FinalTexture);
glBegin(GL_QUADS);
glTexCoord2f(0.f, 0.f); glVertex2f(0.f, 0.f);
glTexCoord2f(1.f, 0.f); glVertex2f(32.f, 0.f);
glTexCoord2f(1.f, 1.f); glVertex2f(32.f, 32.f);
glTexCoord2f(0.f, 1.f); glVertex2f(0.f, 32.f);
glEnd();
Image is loaded properly from what I've gathered using a SpriteSFML Version: SFML 2.0 RC
Does anyone see anything wrong with what I'm doing? I've looked at quite a few example of OpenGL texture loading and this is what I've ascertained from them.
~Thanks