mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Added love.graphics.isActive. love.graphics function calls (and method calls on objects created via love.graphics) are only guaranteed to work when isActive is true, otherwise bad things might happen (the program crashing, for example.)
It's usually only false when the app is inactive on iOS, and when the window hasn't been created yet. --HG-- branch : minor
This commit is contained in:
@@ -178,6 +178,20 @@ public:
|
||||
**/
|
||||
virtual void unSetMode() = 0;
|
||||
|
||||
/**
|
||||
* Sets whether the module is active (internal use only.)
|
||||
**/
|
||||
virtual void setActive(bool active) = 0;
|
||||
|
||||
/**
|
||||
* Gets whether the module is active. Graphics module methods are only
|
||||
* guaranteed to work when it is active. Calling them otherwise may cause
|
||||
* the program to crash (or worse.)
|
||||
* Normally the module will always be active as long as a window exists, it
|
||||
* may be different on some platforms (especially mobile ones.)
|
||||
**/
|
||||
virtual bool isActive() const = 0;
|
||||
|
||||
static bool getConstant(const char *in, DrawMode &out);
|
||||
static bool getConstant(DrawMode in, const char *&out);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user