diff options
author | bunnei <bunneidev@gmail.com> | 2018-01-15 06:20:19 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-01-15 06:20:19 +0100 |
commit | 92801b1c345f2aa47d0b89c91313b44c08edbb86 (patch) | |
tree | e2c470cd5132b0b293bc118f21e24174c4397f2a | |
parent | renderer: Render previous frame when no new one is available. (diff) | |
download | yuzu-92801b1c345f2aa47d0b89c91313b44c08edbb86.tar yuzu-92801b1c345f2aa47d0b89c91313b44c08edbb86.tar.gz yuzu-92801b1c345f2aa47d0b89c91313b44c08edbb86.tar.bz2 yuzu-92801b1c345f2aa47d0b89c91313b44c08edbb86.tar.lz yuzu-92801b1c345f2aa47d0b89c91313b44c08edbb86.tar.xz yuzu-92801b1c345f2aa47d0b89c91313b44c08edbb86.tar.zst yuzu-92801b1c345f2aa47d0b89c91313b44c08edbb86.zip |
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 9 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.h | 4 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index f1c3ff948..50396b5c1 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -293,16 +293,16 @@ void RendererOpenGL::LoadFBToScreenInfo(const FramebufferInfo& framebuffer_info, * Fills active OpenGL texture with the given RGB color. Since the color is solid, the texture can * be 1x1 but will stretch across whatever it's rendered on. */ -void RendererOpenGL::LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b, +void RendererOpenGL::LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b, u8 color_a, const TextureInfo& texture) { state.texture_units[0].texture_2d = texture.resource.handle; state.Apply(); glActiveTexture(GL_TEXTURE0); - u8 framebuffer_data[3] = {color_r, color_g, color_b}; + u8 framebuffer_data[4] = {color_a, color_b, color_g, color_r}; // Update existing texture - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, framebuffer_data); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, framebuffer_data); state.texture_units[0].texture_2d = 0; state.Apply(); @@ -364,6 +364,9 @@ void RendererOpenGL::InitOpenGLObjects() { state.texture_units[0].texture_2d = 0; state.Apply(); + + // Clear screen to black + LoadColorToActiveGLTexture(0, 0, 0, 0, screen_info.texture); } void RendererOpenGL::ConfigureFramebufferTexture(TextureInfo& texture, diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h index 2f5e35787..dd01e1b1a 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h @@ -60,8 +60,8 @@ private: // Loads framebuffer from emulated memory into the display information structure void LoadFBToScreenInfo(const FramebufferInfo& framebuffer_info, ScreenInfo& screen_info); - // Fills active OpenGL texture with the given RGB color. - void LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b, const TextureInfo& texture); + // Fills active OpenGL texture with the given RGBA color. + void LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b, u8 color_a, const TextureInfo& texture); EmuWindow* render_window; ///< Handle to render window |