[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RfC PATCH 2/3] sdl2: add support for display rendering
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [RfC PATCH 2/3] sdl2: add support for display rendering using opengl. |
Date: |
Mon, 12 Jan 2015 13:46:48 +0100 |
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