Browse Source

revert Texture.h .cpp

mozeal 12 years ago
parent
commit
68d7c18f89
2 changed files with 0 additions and 52 deletions
  1. 0 38
      gameplay/src/Texture.cpp
  2. 0 14
      gameplay/src/Texture.h

+ 0 - 38
gameplay/src/Texture.cpp

@@ -155,44 +155,6 @@ Texture* Texture::create(Image* image, bool generateMipmaps)
     }
 }
 
-Texture* Texture::createCubeMap(const char* path[6], bool generateMipmaps)
-{
-    // Create and load the texture.
-    GLuint textureId;
-    GL_ASSERT( glGenTextures(1, &textureId) );
-    GL_ASSERT( glBindTexture(GL_TEXTURE_CUBE_MAP, textureId) );
-    GL_ASSERT( glPixelStorei(GL_UNPACK_ALIGNMENT, 1) );
-    
-    Image* image;
-    Format format;
-    for (int f = 0; f < 6; ++f) {
-        image = Image::create(path[f]);
-        
-        if( image->getFormat() == Image::RGB )
-            format = Texture::RGB;
-        else if( image->getFormat() == Image::RGBA )
-            format = Texture::RGBA;
-        else
-            return NULL;
-        
-        GLenum face = GL_TEXTURE_CUBE_MAP_POSITIVE_X + f;
-        glTexImage2D(face, 0, format, image->getWidth(), image->getHeight(), 0, format, GL_UNSIGNED_BYTE, image->getData());
-    }
-    Filter minFilter = generateMipmaps ? NEAREST_MIPMAP_LINEAR : LINEAR;
-    GL_ASSERT( glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, minFilter) );
-    glGenerateMipmap(GL_TEXTURE_CUBE_MAP);
-    
-    Texture* texture = new Texture();
-    texture->_handle = textureId;
-    texture->_format = format;
-    texture->_width = image->getWidth();
-    texture->_height = image->getHeight();
-    texture->_minFilter = minFilter;
-    
-    return texture;
-}
-
-
 Texture* Texture::create(Format format, unsigned int width, unsigned int height, unsigned char* data, bool generateMipmaps)
 {
     // Create and load the texture.

+ 0 - 14
gameplay/src/Texture.h

@@ -152,20 +152,6 @@ public:
      */
     static Texture* create(const char* path, bool generateMipmaps = false);
 
-    /**
-     * Creates a texture from the given image resource.
-     *
-     * Note that for textures that include mipmap data in the source data (such as most compressed textures),
-     * the generateMipmaps flags should NOT be set to true.
-     *
-     * @param The array of 6 of path The image resource path.
-     * @param generateMipmaps true to auto-generate a full mipmap chain, false otherwise.
-     *
-     * @return The new texture, or NULL if the texture could not be loaded/created.
-     * @script{create}
-     */
-    static Texture* createCubeMap(const char* path[6], bool generateMipmaps = false);
-
     /**
      * Creates a texture from the given image.
      *