Received: from eggs.gnu.org ([2001:4830:134:3::10]:34706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yv5G4-0008N6-46 for qemu-devel@nongnu.org; Wed, 20 May 2015 10:46:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yv5G0-0005dF-KA for qemu-devel@nongnu.org; Wed, 20 May 2015 10:46:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38290) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yv5G0-0005cm-By for qemu-devel@nongnu.org; Wed, 20 May 2015 10:46:04 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4KEk3op031452 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 20 May 2015 10:46:03 -0400 Message-ID: <1432133161.32168.82.camel@nilsson.home.kraxel.org> From: Gerd Hoffmann Date: Wed, 20 May 2015 16:46:01 +0200 In-Reply-To: <555C7AE1.7090204@redhat.com> References: <1432045761-15543-1-git-send-email-kraxel@redhat.com> <1432045761-15543-4-git-send-email-kraxel@redhat.com> <555C7AE1.7090204@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/4] ui: add egl-helpers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: qemu-devel@nongnu.org Hi, > > + egl_dbg("eglInitialize ...\n"); > > + b = eglInitialize(qemu_egl_display, &major, &minor); > > + if (!b) { > > + fprintf(stderr, "egl: eglInitialize failed\n"); > > + return -1; > > + } > > Should we care for eglTerminate() after this point (on error) or do we > just assume there's no hope on failure anyway? Currently qemu will exit() on failure anyway. > > + egl_dbg("eglChooseConfig ...\n"); > > + b = eglChooseConfig(qemu_egl_display, > > + gles ? conf_att_gles : conf_att_gl, > > + &qemu_egl_config, 1, &n); > > Well... It would be sad if the system actually supported true color > (like basically any system everywhere) and we get some 5/6/5 > configuration here (or even worse). I'd expect the system to simply return the best config here ... > (5/6/5 for R/G/B bit sizes). Fixed that. > > + fprintf(stderr, "egl: eglCreateContext failed\n"); > > + return NULL; > > + } > > + > > + b = eglMakeCurrent(qemu_egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, ectx); > > What is this call for? So that some rudimentary OpenGL operations can be > executed which don't need access to a framebuffer? Yes. Saw this in sample code: First make context active without surface, then create surface, then make context active again, this time with the fresh created surface. Which made me think it is probably a good idea to make the new context active even without surface. cheers, Gerd