summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_base.h2
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp8
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.h2
-rw-r--r--src/video_core/video_core.cpp12
-rw-r--r--src/video_core/video_core.h2
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();