diff options
Diffstat (limited to 'src/video_core')
-rw-r--r-- | src/video_core/CMakeLists.txt | 7 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 4 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.h | 4 | ||||
-rw-r--r-- | src/video_core/utils.cpp | 8 | ||||
-rw-r--r-- | src/video_core/video_core.cpp | 3 |
5 files changed, 16 insertions, 10 deletions
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index 56394b930..e43e6e1bb 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt @@ -2,4 +2,9 @@ set(SRCS video_core.cpp utils.cpp renderer_opengl/renderer_opengl.cpp) -add_library(video_core STATIC ${SRCS}) +set(HEADERS video_core.h + utils.h + renderer_base.h + renderer_opengl/renderer_opengl.h) + +add_library(video_core STATIC ${SRCS} ${HEADERS}) diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 24f9a91fd..bb5eb34aa 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -37,7 +37,7 @@ void RendererOpenGL::SwapBuffers() { // EFB->XFB copy // TODO(bunnei): This is a hack and does not belong here. The copy should be triggered by some // register write We're also treating both framebuffers as a single one in OpenGL. - Rect framebuffer_size(0, 0, m_resolution_width, m_resolution_height); + common::Rect framebuffer_size(0, 0, m_resolution_width, m_resolution_height); RenderXFB(framebuffer_size, framebuffer_size); // XFB->Window copy @@ -75,7 +75,7 @@ void RendererOpenGL::FlipFramebuffer(const u8* in, u8* out) { * @param src_rect Source rectangle in XFB to copy * @param dst_rect Destination rectangle in output framebuffer to copy to */ -void RendererOpenGL::RenderXFB(const Rect& src_rect, const Rect& dst_rect) { +void RendererOpenGL::RenderXFB(const common::Rect& src_rect, const common::Rect& dst_rect) { FlipFramebuffer(LCD::GetFramebufferPointer(LCD::g_regs.framebuffer_top_left_1), m_xfb_top_flipped); FlipFramebuffer(LCD::GetFramebufferPointer(LCD::g_regs.framebuffer_sub_left_1), m_xfb_bottom_flipped); diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h index 4c0b6e59d..dd811cad6 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h @@ -28,7 +28,7 @@ public: * @param src_rect Source rectangle in XFB to copy * @param dst_rect Destination rectangle in output framebuffer to copy to */ - void RenderXFB(const Rect& src_rect, const Rect& dst_rect); + void RenderXFB(const common::Rect& src_rect, const common::Rect& dst_rect); /** * Set the emulator window to use for renderer @@ -59,7 +59,7 @@ private: * @param out Pointer to output buffer with flipped framebuffer * @todo Early on hack... I'd like to find a more efficient way of doing this /bunnei */ - void RendererOpenGL::FlipFramebuffer(const u8* in, u8* out); + void FlipFramebuffer(const u8* in, u8* out); EmuWindow* m_render_window; ///< Handle to render window diff --git a/src/video_core/utils.cpp b/src/video_core/utils.cpp index 67d74a2d8..b94376ac1 100644 --- a/src/video_core/utils.cpp +++ b/src/video_core/utils.cpp @@ -8,7 +8,6 @@ #include "video_core/utils.h" namespace VideoCore { - /** * Dumps a texture to TGA * @param filename String filename to dump texture to @@ -32,9 +31,9 @@ void DumpTGA(std::string filename, int width, int height, u8* raw_data) { fwrite(&hdr, sizeof(TGAHeader), 1, fout); for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { - r = raw_data[(4 * (i * width)) + (4 * j) + 0]; - g = raw_data[(4 * (i * width)) + (4 * j) + 1]; - b = raw_data[(4 * (i * width)) + (4 * j) + 2]; + b = raw_data[(3 * (i * width)) + (3 * j) + 0]; + g = raw_data[(3 * (i * width)) + (3 * j) + 1]; + r = raw_data[(3 * (i * width)) + (3 * j) + 2]; putc(b, fout); putc(g, fout); putc(r, fout); @@ -42,5 +41,4 @@ void DumpTGA(std::string filename, int width, int height, u8* raw_data) { } fclose(fout); } - } // namespace diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index f2e17f9f9..cbd540bdf 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp @@ -30,6 +30,9 @@ void Start() { /// Initialize the video core void Init(EmuWindow* emu_window) { + // Known problem with GLEW prevents contexts above 2.x on OSX unless glewExperimental is enabled. + glewExperimental = GL_TRUE; + g_emu_window = emu_window; g_emu_window->MakeCurrent(); g_renderer = new RendererOpenGL(); |