Skip to content

Commit

Permalink
- use a unique_ptr for the GL debug object.
Browse files Browse the repository at this point in the history
This doesn’t get shared and the containing class doesn’t need to be copied so this is sufficient.
  • Loading branch information
coelckers committed Jun 6, 2022
1 parent 989dcfc commit c7798d5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/common/rendering/gl/gl_framebuffer.cpp
Expand Up @@ -175,7 +175,7 @@ void OpenGLFrameBuffer::InitializeState()
GLRenderer->Initialize(GetWidth(), GetHeight());
static_cast<GLDataBuffer*>(mLights->GetBuffer())->BindBase();

mDebug = std::make_shared<FGLDebug>();
mDebug = std::make_unique<FGLDebug>();
mDebug->Update();
}

Expand Down
3 changes: 1 addition & 2 deletions src/common/rendering/gl/gl_framebuffer.h
Expand Up @@ -20,7 +20,6 @@ class OpenGLFrameBuffer : public SystemGLFrameBuffer

public:

explicit OpenGLFrameBuffer() {}
OpenGLFrameBuffer(void *hMonitor, bool fullscreen) ;
~OpenGLFrameBuffer();
bool CompileNextShader() override;
Expand Down Expand Up @@ -66,7 +65,7 @@ class OpenGLFrameBuffer : public SystemGLFrameBuffer
void PostProcessScene(bool swscene, int fixedcm, float flash, const std::function<void()> &afterBloomDrawEndScene2D) override;

bool HWGammaActive = false; // Are we using hardware or software gamma?
std::shared_ptr<FGLDebug> mDebug; // Debug API
std::unique_ptr<FGLDebug> mDebug; // Debug API

FTexture *WipeStartScreen() override;
FTexture *WipeEndScreen() override;
Expand Down
2 changes: 0 additions & 2 deletions src/common/rendering/gles/gles_framebuffer.h
Expand Up @@ -10,7 +10,6 @@ namespace OpenGLESRenderer
{

class FHardwareTexture;
class FGLDebug;

class OpenGLFrameBuffer : public SystemGLFrameBuffer
{
Expand Down Expand Up @@ -61,7 +60,6 @@ class OpenGLFrameBuffer : public SystemGLFrameBuffer
void PostProcessScene(bool swscene, int fixedcm, float flash, const std::function<void()> &afterBloomDrawEndScene2D) override;

bool HWGammaActive = false; // Are we using hardware or software gamma?
std::shared_ptr<FGLDebug> mDebug; // Debug API

FTexture *WipeStartScreen() override;
FTexture *WipeEndScreen() override;
Expand Down

0 comments on commit c7798d5

Please sign in to comment.