mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Replaced the old stencil API with love.graphics.drawStencil(stencilfunc), love.graphics.setStencilTest(enable, invert), and love.graphics.getStencilTest.
Draw to the stencil buffer (rather than the color buffer) using love.graphics.drawStencil with a function which draws geometry. Once the stencil buffer has been drawn to, use love.graphics.setStencilTest before drawing to let drawn geometry be affected by it.
love.graphics.clear (and Canvas:clear) will clear both the color and stencil buffers by default. love.graphics.clear("stencil") will clear only the stencil buffer.
--HG--
branch : stencil-functions
This commit is contained in:
@@ -103,6 +103,13 @@ public:
|
||||
STACK_MAX_ENUM
|
||||
};
|
||||
|
||||
enum ClearType
|
||||
{
|
||||
CLEAR_ALL,
|
||||
CLEAR_STENCIL,
|
||||
CLEAR_MAX_ENUM
|
||||
};
|
||||
|
||||
struct RendererInfo
|
||||
{
|
||||
std::string name;
|
||||
@@ -158,6 +165,9 @@ public:
|
||||
static bool getConstant(const char *in, StackType &out);
|
||||
static bool getConstant(StackType in, const char *&out);
|
||||
|
||||
static bool getConstant(const char *in, ClearType &out);
|
||||
static bool getConstant(ClearType in, const char *&out);
|
||||
|
||||
private:
|
||||
|
||||
static StringMap<DrawMode, DRAW_MAX_ENUM>::Entry drawModeEntries[];
|
||||
@@ -184,6 +194,9 @@ private:
|
||||
static StringMap<StackType, STACK_MAX_ENUM>::Entry stackTypeEntries[];
|
||||
static StringMap<StackType, STACK_MAX_ENUM> stackTypes;
|
||||
|
||||
static StringMap<ClearType, CLEAR_MAX_ENUM>::Entry clearTypeEntries[];
|
||||
static StringMap<ClearType, CLEAR_MAX_ENUM> clearTypes;
|
||||
|
||||
}; // Graphics
|
||||
|
||||
} // graphics
|
||||
|
||||
Reference in New Issue
Block a user