mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Added optional xoffset/yoffset/width/height arguments to Image:refresh, to specify a sub-rectangle. Specifying a small sub-rectangle can improve the performance of Image:refresh.
--HG-- branch : minor
This commit is contained in:
@@ -133,7 +133,7 @@ public:
|
||||
* Re-uploads the ImageData or CompressedData associated with this Image to
|
||||
* the GPU.
|
||||
**/
|
||||
bool refresh();
|
||||
bool refresh(int xoffset, int yoffset, int w, int h);
|
||||
|
||||
const Flags &getFlags() const;
|
||||
|
||||
@@ -153,10 +153,18 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
void uploadDefaultTexture();
|
||||
|
||||
void drawv(const Matrix &t, const Vertex *v);
|
||||
|
||||
void preload();
|
||||
|
||||
void generateMipmaps();
|
||||
void loadDefaultTexture();
|
||||
void loadTextureFromCompressedData();
|
||||
void loadTextureFromImageData();
|
||||
void uploadImageData(int xoffset, int yoffset, int w, int h);
|
||||
|
||||
GLenum getCompressedFormat(image::CompressedData::Format cformat) const;
|
||||
|
||||
// The ImageData from which the texture is created. May be null if
|
||||
// Compressed image data was used to create the texture.
|
||||
Object::StrongRef<love::image::ImageData> data;
|
||||
@@ -183,19 +191,11 @@ private:
|
||||
|
||||
size_t textureMemorySize;
|
||||
|
||||
void preload();
|
||||
|
||||
void uploadCompressedData();
|
||||
void uploadImageData();
|
||||
void uploadTexture();
|
||||
|
||||
static float maxMipmapSharpness;
|
||||
|
||||
static FilterMode defaultMipmapFilter;
|
||||
static float defaultMipmapSharpness;
|
||||
|
||||
GLenum getCompressedFormat(image::CompressedData::Format cformat) const;
|
||||
|
||||
static StringMap<FlagType, FLAG_TYPE_MAX_ENUM>::Entry flagNameEntries[];
|
||||
static StringMap<FlagType, FLAG_TYPE_MAX_ENUM> flagNames;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user