From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAeOg-00084T-Bf for qemu-devel@nongnu.org; Mon, 12 Jan 2015 07:47:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAeOd-0007ce-0T for qemu-devel@nongnu.org; Mon, 12 Jan 2015 07:47:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAeOc-0007cZ-QC for qemu-devel@nongnu.org; Mon, 12 Jan 2015 07:47:02 -0500 Message-ID: <1421066808.8695.31.camel@nilsson.home.kraxel.org> From: Gerd Hoffmann Date: Mon, 12 Jan 2015 13:46:48 +0100 In-Reply-To: <548AEEF7.1000206@redhat.com> References: <1418295956-22479-1-git-send-email-kraxel@redhat.com> <1418295956-22479-3-git-send-email-kraxel@redhat.com> <5489BEE2.7090107@redhat.com> <1418382297.23141.23.camel@nilsson.home.kraxel.org> <548AEEF7.1000206@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RfC PATCH 2/3] sdl2: add support for display rendering using opengl. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: qemu-devel@nongnu.org, Anthony Liguori Hi, > >>> + glBegin(GL_QUADS); > >>> + glTexCoord2f(0, 1); glVertex3f(-1, -1, 0); > >>> + glTexCoord2f(0, 0); glVertex3f(-1, 1, 0); > >>> + glTexCoord2f(1, 0); glVertex3f(1, 1, 0); > >>> + glTexCoord2f(1, 1); glVertex3f(1, -1, 0); > >>> + glEnd(); > >> I've been trained to hate direct mode, but it should be fine for just > >> this quad. > > --verbose please. Guess for longer sequences it would be much more > > efficient to compile this into a shader program? > > Well, again, I'm used to OpenGL 3/4 Core now which doesn't have the > immediate mode any more. [ ... ] > [ ... ] and maybe for some > reason there are people which want to use qemu with OpenGL acceleration > on a pre OpenGL 2 machine. For virtio-gpu we'll need OPENGL 3 anyway, so I don't feel like caring too much about old opengl versions. How would the opengl 3/4 version of the above would look like? > >> Using glTexSubImage2D() would give us the advantage of being able to > >> perform partial updates on the texture; but it seems to fit pretty bad > >> into the existing code. To make it fit, I'd call glTexSubImage2D() > >> directly in sdl2_gl_update() and just draw the quad here. > > Yes, that should work. Done, also factoring this into helper functions so gtk can use this too some day, new series sent out, please have a look. thanks, Gerd