mirror of
https://github.com/love2d/love.git
synced 2026-08-12 16:40:57 +02:00
Only use opengl debug groups if the LOVE_GRAPHICS_DEBUG environment variable is set to 1.
--HG-- branch : minor
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
|
||||
// C++
|
||||
#include <algorithm>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace love
|
||||
{
|
||||
@@ -35,6 +36,8 @@ namespace graphics
|
||||
{
|
||||
|
||||
static bool gammaCorrect = false;
|
||||
static bool debugMode = false;
|
||||
static bool debugModeQueried = false;
|
||||
|
||||
void setGammaCorrect(bool gammacorrect)
|
||||
{
|
||||
@@ -80,6 +83,18 @@ Colorf unGammaCorrectColor(const Colorf &c)
|
||||
return r;
|
||||
}
|
||||
|
||||
bool isDebugEnabled()
|
||||
{
|
||||
if (!debugModeQueried)
|
||||
{
|
||||
const char *debugenv = getenv("LOVE_GRAPHICS_DEBUG");
|
||||
debugMode = debugenv != nullptr && debugenv[0] != '0';
|
||||
debugModeQueried = true;
|
||||
}
|
||||
|
||||
return debugMode;
|
||||
}
|
||||
|
||||
love::Type Graphics::type("graphics", &Module::type);
|
||||
|
||||
Shader::ShaderSource Graphics::defaultShaderCode[Shader::LANGUAGE_MAX_ENUM][2];
|
||||
|
||||
Reference in New Issue
Block a user