Browse Source

Merge pull request #1099 from rgngl/textureInitializerFix

Texture: Make the data buffer parameter in the initializer const.
Sean Paul Taylor 12 năm trước cách đây
mục cha
commit
8c46299022

+ 1 - 1
gameplay/src/Texture.cpp

@@ -155,7 +155,7 @@ Texture* Texture::create(Image* image, bool generateMipmaps)
     }
     }
 }
 }
 
 
-Texture* Texture::create(Format format, unsigned int width, unsigned int height, unsigned char* data, bool generateMipmaps)
+Texture* Texture::create(Format format, unsigned int width, unsigned int height, const unsigned char* data, bool generateMipmaps)
 {
 {
     // Create and load the texture.
     // Create and load the texture.
     GLuint textureId;
     GLuint textureId;

+ 1 - 1
gameplay/src/Texture.h

@@ -177,7 +177,7 @@ public:
      * @return The new texture.
      * @return The new texture.
      * @script{create}
      * @script{create}
      */
      */
-    static Texture* create(Format format, unsigned int width, unsigned int height, unsigned char* data, bool generateMipmaps = false);
+    static Texture* create(Format format, unsigned int width, unsigned int height, const unsigned char* data, bool generateMipmaps = false);
 
 
     /**
     /**
      * Creates a texture object to wrap the specified pre-created native texture handle.
      * Creates a texture object to wrap the specified pre-created native texture handle.