   Lesson 6 problem (mirrored textures)
  Hi,I'm trying to modify Lesson 6 to make it use the Corona library for the image loading part.The problem here is that currently it looks like this... which is obviously not okay, but I have no idea what causes it.Is it me doing something wrong, or is it because Corona "sorts" the image differently in memory, or maybe something else entirely?Here's the code for the loader and the draw function (the latter is mostly a pure C&P though, but I'll post it here anyway just in case):BOOL GLDrawObject::LoadTexture(char* pFilename, int iTexNo){    if (iTexNo>(TEX_Q-1)){ MessageBox (HWND_DESKTOP, "Texture index out of range", "FAIL", MB_OK | MB_ICONEXCLAMATION);  return FALSE; }    corona::Image* Image = corona::OpenImage(pFilename, corona::FF_AUTODETECT);    if (!Image){ MessageBox (HWND_DESKTOP, "Error loading texture", "FAIL", MB_OK | MB_ICONEXCLAMATION);  return FALSE; }m_stTexArray[iTexNo].iWidth= Image->getWidth();m_stTexArray[iTexNo].iHeight= Image->getHeight();m_stTexArray[iTexNo].sImageData = (GLubyte*)Image->getPixels();glGenTextures(1, &m_stTexArray[iTexNo].iTexID);glBindTexture(GL_TEXTURE_2D, m_stTexArray[iTexNo].iTexID);glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);glTexImage2D(GL_TEXTURE_2D, 0, 3, m_stTexArray[iTexNo].iWidth, m_stTexArray[iTexNo].iHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, m_stTexArray[iTexNo].sImageData);    delete Image;    return TRUE;}void GLDrawObject::Draw(void){glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);// Clear The Screen And The Depth BufferglLoadIdentity();// Reset The ViewglTranslatef(0.0f,0.0f,-5.0f);// Move Into The Screen 5 UnitsglRotatef(m_fXrot,1.0f,0.0f,0.0f);// Rotate On The X AxisglRotatef(m_fYrot,0.0f,1.0f,0.0f);// Rotate On The Y AxisglRotatef(m_fZrot,0.0f,0.0f,1.0f);// Rotate On The Z AxisglBindTexture(GL_TEXTURE_2D, m_stTexArray[m_iTexNo].iTexID);// Select Our TextureglBegin(GL_QUADS);// Front FaceglTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f,  1.0f);// Bottom Left Of The Texture and QuadglTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, -1.0f,  1.0f);// Bottom Right Of The Texture and QuadglTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f,  1.0f,  1.0f);// Top Right Of The Texture and QuadglTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f,  1.0f,  1.0f);// Top Left Of The Texture and Quad// Back FaceglTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, -1.0f);glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f,  1.0f, -1.0f);glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f,  1.0f, -1.0f);glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, -1.0f, -1.0f);// Top FaceglTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f,  1.0f, -1.0f);glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,  1.0f,  1.0f);glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f,  1.0f,  1.0f);glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f,  1.0f, -1.0f);// Bottom FaceglTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f, -1.0f, -1.0f);glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f, -1.0f, -1.0f);glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, -1.0f,  1.0f);glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -1.0f,  1.0f);// Right faceglTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, -1.0f, -1.0f);glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f,  1.0f, -1.0f);glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f,  1.0f,  1.0f);glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, -1.0f,  1.0f);// Left FaceglTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, -1.0f);glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -1.0f,  1.0f);glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f,  1.0f,  1.0f);glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f,  1.0f, -1.0f);glEnd();}[Edited by - 001i on May 8, 2010 5:32:18 PM]