diff options
author | LittleWhite <lw.demoscene@googlemail.com> | 2016-01-07 20:33:54 +0100 |
---|---|---|
committer | LittleWhite <lw.demoscene@googlemail.com> | 2016-03-08 22:05:25 +0100 |
commit | 4be68dddfbdc7065139351e6e39b5fa97844264a (patch) | |
tree | 4b020326a58a7a4364b752cb731233cb6c264cd0 /src/video_core | |
parent | Display errors in GUI when loading ROM failed (diff) | |
download | yuzu-4be68dddfbdc7065139351e6e39b5fa97844264a.tar yuzu-4be68dddfbdc7065139351e6e39b5fa97844264a.tar.gz yuzu-4be68dddfbdc7065139351e6e39b5fa97844264a.tar.bz2 yuzu-4be68dddfbdc7065139351e6e39b5fa97844264a.tar.lz yuzu-4be68dddfbdc7065139351e6e39b5fa97844264a.tar.xz yuzu-4be68dddfbdc7065139351e6e39b5fa97844264a.tar.zst yuzu-4be68dddfbdc7065139351e6e39b5fa97844264a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_base.h | 2 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 8 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.h | 2 | ||||
-rw-r--r-- | src/video_core/video_core.cpp | 12 | ||||
-rw-r--r-- | src/video_core/video_core.h | 2 |
5 files changed, 18 insertions, 8 deletions
diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h index 506bff815..91a7b7f17 100644 --- a/src/video_core/renderer_base.h +++ b/src/video_core/renderer_base.h @@ -38,7 +38,7 @@ public: virtual void SetWindow(EmuWindow* window) = 0; /// Initialize the renderer - virtual void Init() = 0; + virtual bool Init() = 0; /// Shutdown the renderer virtual void ShutDown() = 0; diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index ca3a6a6b4..11c4d0daf 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -445,7 +445,7 @@ static void DebugHandler(GLenum source, GLenum type, GLuint id, GLenum severity, } /// Initialize the renderer -void RendererOpenGL::Init() { +bool RendererOpenGL::Init() { render_window->MakeCurrent(); // TODO: Make frontends initialize this, so they can use gladLoadGLLoader with their own loaders @@ -462,9 +462,15 @@ void RendererOpenGL::Init() { LOG_INFO(Render_OpenGL, "GL_VERSION: %s", glGetString(GL_VERSION)); LOG_INFO(Render_OpenGL, "GL_VENDOR: %s", glGetString(GL_VENDOR)); LOG_INFO(Render_OpenGL, "GL_RENDERER: %s", glGetString(GL_RENDERER)); + if (!GLAD_GL_VERSION_3_3) { + return false; + } + InitOpenGLObjects(); RefreshRasterizerSetting(); + + return true; } /// Shutdown the renderer diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h index b42df7654..fe4d142a5 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h @@ -31,7 +31,7 @@ public: void SetWindow(EmuWindow* window) override; /// Initialize the renderer - void Init() override; + bool Init() override; /// Shutdown the renderer void ShutDown() override; diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index 912db91a4..ee5e50df1 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp @@ -28,15 +28,19 @@ std::atomic<bool> g_hw_renderer_enabled; std::atomic<bool> g_shader_jit_enabled; /// Initialize the video core -void Init(EmuWindow* emu_window) { +bool Init(EmuWindow* emu_window) { Pica::Init(); g_emu_window = emu_window; g_renderer = Common::make_unique<RendererOpenGL>(); g_renderer->SetWindow(g_emu_window); - g_renderer->Init(); - - LOG_DEBUG(Render, "initialized OK"); + if (g_renderer->Init()) { + LOG_DEBUG(Render, "initialized OK"); + } else { + LOG_ERROR(Render, "initialization failed !"); + return false; + } + return true; } /// Shutdown the video core diff --git a/src/video_core/video_core.h b/src/video_core/video_core.h index accb0a4eb..bca67fb8c 100644 --- a/src/video_core/video_core.h +++ b/src/video_core/video_core.h @@ -41,7 +41,7 @@ extern std::atomic<bool> g_shader_jit_enabled; void Start(); /// Initialize the video core -void Init(EmuWindow* emu_window); +bool Init(EmuWindow* emu_window); /// Shutdown the video core void Shutdown(); |