//! copies the the texture into an open gl texture. void COpenGLTexture::uploadTexture(bool newTexture, void* mipmapData, u32 level) { // check which image needs to be uploaded IImage* image = level?MipImage:Image; if (!image) { os::Printer::log("No image for OpenGL texture to upload", ELL_ERROR); return; } printf("we in!\n"); // get correct opengl color data values GLenum oldInternalFormat = InternalFormat; GLint filtering; InternalFormat = getOpenGLFormatAndParametersFromColorFormat(ColorFormat, filtering, PixelFormat, PixelType); // make sure we don't change the internal format of existing images if (!newTexture) InternalFormat=oldInternalFormat; Driver->setActiveTexture(0, this); if (Driver->testGLError()) os::Printer::log("Could not bind Texture", ELL_ERROR); // now get image data and upload to GPU void* source = image->lock(); /* if (newTexture) glTexImage2D(GL_TEXTURE_2D, level, InternalFormat, image->getDimension().Width, image->getDimension().Height, 0, PixelFormat, PixelType, source); else glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, image->getDimension().Width, image->getDimension().Height, PixelFormat, PixelType, source); */ image->unlock(); }