mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
add texture:getDebugName and buffer:getDebugName
This commit is contained in:
@@ -68,7 +68,6 @@ static GLenum getGLFormat(DataFormat format)
|
||||
|
||||
Buffer::Buffer(love::graphics::Graphics *gfx, const Settings &settings, const std::vector<DataDeclaration> &format, const void *data, size_t size, size_t arraylength)
|
||||
: love::graphics::Buffer(gfx, settings, format, size, arraylength)
|
||||
, debugName(settings.debugName)
|
||||
{
|
||||
size = getSize();
|
||||
arraylength = getArrayLength();
|
||||
@@ -165,8 +164,8 @@ bool Buffer::load(const void *initialdata)
|
||||
glTexBuffer(target, glformat, buffer);
|
||||
}
|
||||
|
||||
if (!debugName.empty())
|
||||
glObjectLabel(GL_BUFFER, buffer, -1, debugName.c_str());
|
||||
if (debugName.hasValue)
|
||||
glObjectLabel(GL_BUFFER, buffer, -1, debugName.value.c_str());
|
||||
|
||||
return (glGetError() == GL_NO_ERROR);
|
||||
}
|
||||
|
||||
@@ -81,8 +81,6 @@ private:
|
||||
|
||||
Range mappedRange;
|
||||
|
||||
std::string debugName;
|
||||
|
||||
}; // Buffer
|
||||
|
||||
} // opengl
|
||||
|
||||
@@ -227,7 +227,6 @@ Texture::Texture(love::graphics::Graphics *gfx, const Settings &settings, const
|
||||
, framebufferStatus(GL_FRAMEBUFFER_COMPLETE)
|
||||
, textureGLError(GL_NO_ERROR)
|
||||
, actualSamples(1)
|
||||
, debugName(settings.debugName)
|
||||
{
|
||||
if (data != nullptr)
|
||||
slices = *data;
|
||||
@@ -423,12 +422,12 @@ bool Texture::loadVolatile()
|
||||
|
||||
setGraphicsMemorySize(memsize);
|
||||
|
||||
if (!debugName.empty())
|
||||
if (debugName.hasValue)
|
||||
{
|
||||
if (texture)
|
||||
glObjectLabel(GL_TEXTURE, texture, -1, debugName.c_str());
|
||||
glObjectLabel(GL_TEXTURE, texture, -1, debugName.value.c_str());
|
||||
else
|
||||
glObjectLabel(GL_FRAMEBUFFER, renderbuffer, -1, debugName.c_str());
|
||||
glObjectLabel(GL_FRAMEBUFFER, renderbuffer, -1, debugName.value.c_str());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -78,9 +78,6 @@ private:
|
||||
GLenum textureGLError;
|
||||
|
||||
int actualSamples;
|
||||
|
||||
std::string debugName;
|
||||
|
||||
}; // Texture
|
||||
|
||||
} // opengl
|
||||
|
||||
Reference in New Issue
Block a user