summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/renderer_opengl.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.h44
1 files changed, 26 insertions, 18 deletions
diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h
index fe4d142a5..5ca5255ac 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.h
+++ b/src/video_core/renderer_opengl/renderer_opengl.h
@@ -11,10 +11,28 @@
#include "core/hw/gpu.h"
#include "video_core/renderer_base.h"
+#include "video_core/renderer_opengl/gl_resource_manager.h"
#include "video_core/renderer_opengl/gl_state.h"
class EmuWindow;
+/// Structure used for storing information about the textures for each 3DS screen
+struct TextureInfo {
+ OGLTexture resource;
+ GLsizei width;
+ GLsizei height;
+ GPU::Regs::PixelFormat format;
+ GLenum gl_format;
+ GLenum gl_type;
+};
+
+/// Structure used for storing information about the display target for each 3DS screen
+struct ScreenInfo {
+ GLuint display_texture;
+ MathUtil::Rectangle<float> display_texcoords;
+ TextureInfo texture;
+};
+
class RendererOpenGL : public RendererBase {
public:
@@ -37,26 +55,16 @@ public:
void ShutDown() override;
private:
- /// Structure used for storing information about the textures for each 3DS screen
- struct TextureInfo {
- GLuint handle;
- GLsizei width;
- GLsizei height;
- GPU::Regs::PixelFormat format;
- GLenum gl_format;
- GLenum gl_type;
- };
-
void InitOpenGLObjects();
void ConfigureFramebufferTexture(TextureInfo& texture,
const GPU::Regs::FramebufferConfig& framebuffer);
void DrawScreens();
- void DrawSingleScreenRotated(const TextureInfo& texture, float x, float y, float w, float h);
+ void DrawSingleScreenRotated(const ScreenInfo& screen_info, float x, float y, float w, float h);
void UpdateFramerate();
- // Loads framebuffer from emulated memory into the active OpenGL texture.
- void LoadFBToActiveGLTexture(const GPU::Regs::FramebufferConfig& framebuffer,
- const TextureInfo& texture);
+ // Loads framebuffer from emulated memory into the display information structure
+ void LoadFBToScreenInfo(const GPU::Regs::FramebufferConfig& framebuffer,
+ 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);
@@ -69,10 +77,10 @@ private:
OpenGLState state;
// OpenGL object IDs
- GLuint vertex_array_handle;
- GLuint vertex_buffer_handle;
- GLuint program_id;
- std::array<TextureInfo, 2> textures; ///< Textures for top and bottom screens respectively
+ OGLVertexArray vertex_array;
+ OGLBuffer vertex_buffer;
+ OGLShader shader;
+ std::array<ScreenInfo, 2> screen_infos; ///< Display information for top and bottom screens respectively
// Shader uniform location indices
GLuint uniform_modelview_matrix;
GLuint uniform_color_texture;