diff --git a/plugins/GSdx/Renderers/DX11/GSDevice11.cpp b/plugins/GSdx/Renderers/DX11/GSDevice11.cpp index d0d8623b2f..23b1c3c349 100644 --- a/plugins/GSdx/Renderers/DX11/GSDevice11.cpp +++ b/plugins/GSdx/Renderers/DX11/GSDevice11.cpp @@ -412,7 +412,10 @@ bool GSDevice11::Create(const std::shared_ptr &wnd) } GSVector2i tex_font = m_osd.get_texture_font_size(); - m_font = CreateSurface(GSTexture::Texture, tex_font.x, tex_font.y, false, DXGI_FORMAT_R8_UNORM); + + m_font = std::unique_ptr( + CreateSurface(GSTexture::Texture, tex_font.x, tex_font.y, false, DXGI_FORMAT_R8_UNORM) + ); return true; } @@ -821,11 +824,11 @@ void GSDevice11::RenderOsd(GSTexture* dt) OMSetRenderTargets(dt, NULL); if(m_osd.m_texture_dirty) { - m_osd.upload_texture_atlas(m_font); + m_osd.upload_texture_atlas(m_font.get()); } // ps - PSSetShaderResource(0, m_font); + PSSetShaderResource(0, m_font.get()); PSSetSamplerState(m_convert.pt, NULL); PSSetShader(m_convert.ps[ShaderConvert_OSD], NULL); diff --git a/plugins/GSdx/Renderers/DX11/GSDevice11.h b/plugins/GSdx/Renderers/DX11/GSDevice11.h index 55fb0aedec..94ca7f0221 100644 --- a/plugins/GSdx/Renderers/DX11/GSDevice11.h +++ b/plugins/GSdx/Renderers/DX11/GSDevice11.h @@ -159,7 +159,7 @@ public: // TODO GSConstantBuffer m_gs_cb_cache; PSConstantBuffer m_ps_cb_cache; - GSTexture* m_font; + std::unique_ptr m_font; bool CreateTextureFX(); diff --git a/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.cpp b/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.cpp index 4eb08009b9..8f4a83db6d 100644 --- a/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.cpp +++ b/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.cpp @@ -64,7 +64,6 @@ GSDeviceOGL::GSDeviceOGL() , m_palette_ss(0) , m_vs_cb(NULL) , m_ps_cb(NULL) - , m_font(NULL) , m_shader(NULL) { memset(&m_merge_obj, 0, sizeof(m_merge_obj)); @@ -549,7 +548,10 @@ bool GSDeviceOGL::Create(const std::shared_ptr &wnd) // Texture Font (OSD) // **************************************************************** GSVector2i tex_font = m_osd.get_texture_font_size(); - m_font = new GSTextureOGL(GSTextureOGL::Texture, tex_font.x, tex_font.y, GL_R8, m_fbo_read, false); + + m_font = std::unique_ptr( + new GSTextureOGL(GSTextureOGL::Texture, tex_font.x, tex_font.y, GL_R8, m_fbo_read, false) + ); // **************************************************************** // Finish window setup and backbuffer @@ -1389,10 +1391,10 @@ void GSDeviceOGL::RenderOsd(GSTexture* dt) OMSetRenderTargets(dt, NULL); if(m_osd.m_texture_dirty) { - m_osd.upload_texture_atlas(m_font); + m_osd.upload_texture_atlas(m_font.get()); } - PSSetShaderResource(0, m_font); + PSSetShaderResource(0, m_font.get()); PSSetSamplerState(m_convert.pt); IASetPrimitiveTopology(GL_TRIANGLES); diff --git a/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.h b/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.h index c2f8d0fd7b..3f50fe6a8f 100644 --- a/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.h +++ b/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.h @@ -491,7 +491,7 @@ public: PSConstantBuffer m_ps_cb_cache; MiscConstantBuffer m_misc_cb_cache; - GSTextureOGL* m_font; + std::unique_ptr m_font; GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format); GSTexture* FetchSurface(int type, int w, int h, bool msaa, int format);