Skip to content

Commit b0148f3

Browse files
revmischaMischa
authored andcommitted
refactor: add override specifiers to virtual functions for clarity and safety
1 parent 3636eb4 commit b0148f3

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

src/libprojectM/Renderer/Backend/OpenGL/OpenGLCopyTexture.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ class OpenGLCopyTexture : public CopyTexture, public OpenGLRenderItem
1616
OpenGLCopyTexture();
1717
~OpenGLCopyTexture() = default;
1818

19-
void InitVertexAttrib();
19+
// Mark override for clarity and to avoid hiding warnings
20+
void InitVertexAttrib() override;
21+
22+
// Mark override for clarity and to avoid hiding warnings
23+
void Init() override { OpenGLRenderItem::Init(); }
2024

2125
void Draw(const std::shared_ptr<class Texture>& originalTexture,
2226
bool flipVertical = false, bool flipHorizontal = false) override;

src/libprojectM/Renderer/Backend/OpenGL/OpenGLPresetTransition.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@ class OpenGLPresetTransition : public PresetTransition, public OpenGLRenderItem
1818
double durationSeconds,
1919
double transitionStartTime);
2020

21+
// Mark override for clarity and to avoid hiding warnings
2122
void InitVertexAttrib() override;
2223

24+
// Mark override for clarity and to avoid hiding warnings
25+
void Init() override { OpenGLRenderItem::Init(); }
26+
2327
void Draw(const Preset& oldPreset,
2428
const Preset& newPreset,
2529
const RenderContext& context,

src/libprojectM/Renderer/Backend/OpenGL/OpenGLRenderItem.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ class OpenGLRenderItem : public ::libprojectM::Renderer::RenderItem
1818
OpenGLRenderItem();
1919
virtual ~OpenGLRenderItem();
2020

21-
virtual void InitVertexAttrib();
21+
// Mark override for clarity and to avoid hiding warnings
22+
void InitVertexAttrib() override;
2223

23-
// Override Init to provide OpenGL-specific initialization
24-
virtual void Init();
24+
// Mark override for clarity and to avoid hiding warnings
25+
void Init() override;
2526

2627
protected:
2728
GLuint m_vboID{0};

0 commit comments

Comments
 (0)