mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-29 23:06:23 -05:00
renderer: Create rasterizer and cleanup.
This commit is contained in:
parent
ec5ede68e7
commit
656de23d93
4 changed files with 16 additions and 4 deletions
|
@ -5,6 +5,11 @@
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "video_core/renderer_base.h"
|
#include "video_core/renderer_base.h"
|
||||||
|
#include "video_core/renderer_opengl/gl_rasterizer.h"
|
||||||
#include "video_core/video_core.h"
|
#include "video_core/video_core.h"
|
||||||
|
|
||||||
void RendererBase::RefreshRasterizerSetting() {}
|
void RendererBase::RefreshRasterizerSetting() {
|
||||||
|
if (rasterizer == nullptr) {
|
||||||
|
rasterizer = std::make_unique<RasterizerOpenGL>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include "common/assert.h"
|
#include "common/assert.h"
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
|
#include "video_core/rasterizer_interface.h"
|
||||||
|
|
||||||
class EmuWindow;
|
class EmuWindow;
|
||||||
|
|
||||||
|
@ -74,12 +75,16 @@ public:
|
||||||
return m_current_frame;
|
return m_current_frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VideoCore::RasterizerInterface* Rasterizer() const {
|
||||||
|
return rasterizer.get();
|
||||||
|
}
|
||||||
|
|
||||||
void RefreshRasterizerSetting();
|
void RefreshRasterizerSetting();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
std::unique_ptr<VideoCore::RasterizerInterface> rasterizer;
|
||||||
f32 m_current_fps = 0.0f; ///< Current framerate, should be set by the renderer
|
f32 m_current_fps = 0.0f; ///< Current framerate, should be set by the renderer
|
||||||
int m_current_frame = 0; ///< Current frame, should be set by the renderer
|
int m_current_frame = 0; ///< Current frame, should be set by the renderer
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool opengl_rasterizer_active = false;
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -211,8 +211,8 @@ struct SurfaceParams {
|
||||||
MathUtil::Rectangle<u32> GetSubRect(const SurfaceParams& sub_surface) const;
|
MathUtil::Rectangle<u32> GetSubRect(const SurfaceParams& sub_surface) const;
|
||||||
MathUtil::Rectangle<u32> GetScaledSubRect(const SurfaceParams& sub_surface) const;
|
MathUtil::Rectangle<u32> GetScaledSubRect(const SurfaceParams& sub_surface) const;
|
||||||
|
|
||||||
PAddr addr = 0;
|
VAddr addr = 0;
|
||||||
PAddr end = 0;
|
VAddr end = 0;
|
||||||
u64 size = 0;
|
u64 size = 0;
|
||||||
|
|
||||||
u32 width = 0;
|
u32 width = 0;
|
||||||
|
|
|
@ -15,6 +15,8 @@ class RendererBase;
|
||||||
|
|
||||||
namespace VideoCore {
|
namespace VideoCore {
|
||||||
|
|
||||||
|
enum class Renderer { Software, OpenGL };
|
||||||
|
|
||||||
extern std::unique_ptr<RendererBase> g_renderer; ///< Renderer plugin
|
extern std::unique_ptr<RendererBase> g_renderer; ///< Renderer plugin
|
||||||
extern EmuWindow* g_emu_window; ///< Emu window
|
extern EmuWindow* g_emu_window; ///< Emu window
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue