mirror of
https://github.com/love2d/love.git
synced 2026-08-17 02:58:31 +02:00
Array textures can be easily drawn without a shader (resolves issue #1111).
Added love.graphics.drawLayer(texture, layerindex, …). ‘texture’ must be an array texture. Added SpriteBatch:add/setLayer. Added Quad:get/setLayer. This applies to array textures that are drawn without specifying an explicit layer index in the draw call. Added love.graphics.newQuad variants which have layer arguments. --HG-- branch : minor
This commit is contained in:
@@ -95,6 +95,14 @@ public:
|
||||
UNIFORM_MAX_ENUM
|
||||
};
|
||||
|
||||
enum StandardShader
|
||||
{
|
||||
STANDARD_DEFAULT,
|
||||
STANDARD_VIDEO,
|
||||
STANDARD_ARRAY,
|
||||
STANDARD_MAX_ENUM
|
||||
};
|
||||
|
||||
struct ShaderSource
|
||||
{
|
||||
std::string vertex;
|
||||
@@ -137,8 +145,7 @@ public:
|
||||
static Shader *current;
|
||||
|
||||
// Pointer to the default Shader.
|
||||
static Shader *defaultShader;
|
||||
static Shader *defaultVideoShader;
|
||||
static Shader *standardShaders[STANDARD_MAX_ENUM];
|
||||
|
||||
Shader(const ShaderSource &source);
|
||||
virtual ~Shader();
|
||||
@@ -149,9 +156,14 @@ public:
|
||||
virtual void attach() = 0;
|
||||
|
||||
/**
|
||||
* Attach the default shader.
|
||||
* Attach a default shader.
|
||||
**/
|
||||
static void attachDefault();
|
||||
static void attachDefault(StandardShader defaultType);
|
||||
|
||||
/**
|
||||
* Gets whether any of the default shaders are currently active.
|
||||
**/
|
||||
static bool isDefaultActive();
|
||||
|
||||
/**
|
||||
* Returns any warnings this Shader may have generated.
|
||||
|
||||
Reference in New Issue
Block a user