diff options
author | bunnei <bunneidev@gmail.com> | 2014-08-26 23:34:52 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2014-08-26 23:34:52 +0200 |
commit | 20d169e4a1753bf85c19c2799ace8b50fa2e3fa3 (patch) | |
tree | 9b90eb8eda2a89eeb7302d9fa5af79a466cd695b /src/video_core/renderer_opengl | |
parent | Merge pull request #74 from kevinhartman/master (diff) | |
download | yuzu-20d169e4a1753bf85c19c2799ace8b50fa2e3fa3.tar yuzu-20d169e4a1753bf85c19c2799ace8b50fa2e3fa3.tar.gz yuzu-20d169e4a1753bf85c19c2799ace8b50fa2e3fa3.tar.bz2 yuzu-20d169e4a1753bf85c19c2799ace8b50fa2e3fa3.tar.lz yuzu-20d169e4a1753bf85c19c2799ace8b50fa2e3fa3.tar.xz yuzu-20d169e4a1753bf85c19c2799ace8b50fa2e3fa3.tar.zst yuzu-20d169e4a1753bf85c19c2799ace8b50fa2e3fa3.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 14 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.h | 1 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index dc1b8e28b..6470245e6 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -49,12 +49,17 @@ RendererOpenGL::RendererOpenGL() { resolution_height = VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight; // Initialize screen info - screen_info.Top().width = VideoCore::kScreenTopWidth; - screen_info.Top().height = VideoCore::kScreenTopHeight; - screen_info.Top().flipped_xfb_data = xfb_top_flipped; + const auto& framebuffer_top = GPU::g_regs.framebuffer_config[0]; + const auto& framebuffer_sub = GPU::g_regs.framebuffer_config[1]; + + screen_info.Top().width = VideoCore::kScreenTopWidth; + screen_info.Top().height = VideoCore::kScreenTopHeight; + screen_info.Top().stride = framebuffer_top.stride; + screen_info.Top().flipped_xfb_data = xfb_top_flipped; screen_info.Bottom().width = VideoCore::kScreenBottomWidth; screen_info.Bottom().height = VideoCore::kScreenBottomHeight; + screen_info.Bottom().stride = framebuffer_sub.stride; screen_info.Bottom().flipped_xfb_data = xfb_bottom_flipped; } @@ -90,8 +95,8 @@ void RendererOpenGL::SwapBuffers() { * @todo Early on hack... I'd like to find a more efficient way of doing this /bunnei */ void RendererOpenGL::FlipFramebuffer(const u8* raw_data, ScreenInfo& screen_info) { - int in_coord = 0; for (int x = 0; x < screen_info.width; x++) { + int in_coord = x * screen_info.stride; for (int y = screen_info.height-1; y >= 0; y--) { // TODO: Properly support other framebuffer formats int out_coord = (x + y * screen_info.width) * 3; @@ -184,6 +189,7 @@ void RendererOpenGL::InitFramebuffer() { } void RendererOpenGL::RenderFramebuffer() { + glViewport(0, 0, resolution_width, resolution_height); glClear(GL_COLOR_BUFFER_BIT); glUseProgram(program_id); diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h index b21092f07..423467e4c 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h @@ -57,6 +57,7 @@ private: // Properties int width; int height; + int stride; ///< Number of bytes between the coordinates (0,0) and (1,0) // OpenGL object IDs GLuint texture_id; |