From 26d10da6e53939e9b7852dc678cb4f53502a2c63 Mon Sep 17 00:00:00 2001 From: Bastien Date: Tue, 9 Oct 2018 19:57:58 +0200 Subject: [PATCH] Handle init failures --- examples/opengl/main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/opengl/main.c b/examples/opengl/main.c index 831a494..f49f37a 100644 --- a/examples/opengl/main.c +++ b/examples/opengl/main.c @@ -112,7 +112,13 @@ int main(int argc, char** argv) GLuint list = gen_cubes(); - lvrcInitRenderingEGL(compositor, gl.egl_display, gl.egl_context, gl.egl_surface); + bool bCompositorInit = lvrcInitRenderingEGL(compositor, gl.egl_display, gl.egl_context, gl.egl_surface); + + if (!bCompositorInit) + { + printf ("Could not create compositor\n"); + return -1; + } int eye_w = hmd_w/2*OVERSAMPLE_SCALE; int eye_h = hmd_h*OVERSAMPLE_SCALE; @@ -123,6 +129,7 @@ int main(int argc, char** argv) if (!bSwapChainInit) { + printf ("Could not create swapchain\n"); return -1; }