mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Move internal Slices class from Image to Texture
This commit is contained in:
@@ -33,6 +33,8 @@
|
||||
#include "vertex.h"
|
||||
#include "renderstate.h"
|
||||
#include "Resource.h"
|
||||
#include "image/ImageData.h"
|
||||
#include "image/CompressedImageData.h"
|
||||
|
||||
// C
|
||||
#include <stddef.h>
|
||||
@@ -96,6 +98,43 @@ public:
|
||||
WrapMode r = WRAP_CLAMP;
|
||||
};
|
||||
|
||||
enum MipmapsType
|
||||
{
|
||||
MIPMAPS_NONE,
|
||||
MIPMAPS_DATA,
|
||||
MIPMAPS_GENERATED,
|
||||
};
|
||||
|
||||
struct Slices
|
||||
{
|
||||
public:
|
||||
|
||||
Slices(TextureType textype);
|
||||
|
||||
void clear();
|
||||
void set(int slice, int mipmap, love::image::ImageDataBase *data);
|
||||
love::image::ImageDataBase *get(int slice, int mipmap) const;
|
||||
|
||||
void add(love::image::CompressedImageData *cdata, int startslice, int startmip, bool addallslices, bool addallmips);
|
||||
|
||||
int getSliceCount(int mip = 0) const;
|
||||
int getMipmapCount(int slice = 0) const;
|
||||
|
||||
bool validate() const;
|
||||
|
||||
TextureType getTextureType() const { return textureType; }
|
||||
|
||||
private:
|
||||
|
||||
TextureType textureType;
|
||||
|
||||
// For 2D/Cube/2DArray texture types, each element in the data array has
|
||||
// an array of mipmap levels. For 3D texture types, each mipmap level
|
||||
// has an array of layers.
|
||||
std::vector<std::vector<StrongRef<love::image::ImageDataBase>>> data;
|
||||
|
||||
}; // Slices
|
||||
|
||||
static Filter defaultFilter;
|
||||
static FilterMode defaultMipmapFilter;
|
||||
static float defaultMipmapSharpness;
|
||||
|
||||
Reference in New Issue
Block a user