Fix GLEW clang-tidy issues

This commit is contained in:
Dan Paulat 2025-07-10 23:27:24 -05:00
parent 331b2d855f
commit a6f8547455
15 changed files with 176 additions and 95 deletions

View file

@ -101,6 +101,8 @@ void Rectangle::Initialize()
glBufferData(
GL_ARRAY_BUFFER, sizeof(float) * BUFFER_LENGTH, nullptr, GL_DYNAMIC_DRAW);
// NOLINTBEGIN(performance-no-int-to-ptr)
glVertexAttribPointer(0,
3,
GL_FLOAT,
@ -117,6 +119,8 @@ void Rectangle::Initialize()
reinterpret_cast<void*>(3 * sizeof(float)));
glEnableVertexAttribArray(1);
// NOLINTEND(performance-no-int-to-ptr)
p->dirty_ = true;
}
@ -134,12 +138,14 @@ void Rectangle::Render(const QMapLibre::CustomLayerRenderParameters& params)
if (p->fillColor_.has_value())
{
// Draw fill
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
glDrawArrays(GL_TRIANGLES, 24, 6);
}
if (p->borderWidth_ > 0.0f)
{
// Draw border
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
glDrawArrays(GL_TRIANGLES, 0, 24);
}
}
@ -283,7 +289,7 @@ void Rectangle::Impl::Update()
glBufferData(GL_ARRAY_BUFFER,
sizeof(float) * BUFFER_LENGTH,
buffer,
static_cast<const void*>(buffer),
GL_DYNAMIC_DRAW);
dirty_ = false;