I am importing my own .raw file and creating a texture from it. When I draw it on the screen it appears to be tiled 3x3 and I don’t know why. Can anyone help me out?
Here is what is shown:
And here is the texture I am importing:
void RenderScene() {
// Clear Color and Depth Buffers
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//reset view
glLoadIdentity();
//set up view to camera
gameCamera->MoveGLView();
glEnable( GL_TEXTURE_2D );
glBindTexture( GL_TEXTURE_2D, texture );
double test = 1;
glBegin( GL_QUADS );
glTexCoord2d(0.0, 0.0); glVertex2d(0.0, 0.0);
glTexCoord2d(test, 0.0); glVertex2d(1.0, 0.0);
glTexCoord2d(test, test); glVertex2d(1.0, 1.0);
glTexCoord2d(0.0, test); glVertex2d(0.0, 1.0);
glEnd();
glFlush();
}
And the code I’m using to import the texture from a .raw file
http://www.opengl.org/discussion_boards/showthread.php/179975-Creating-Texture2d-from-a-byte-array?p=1245777&viewfull=1#post1245777