Re: [Qemu-devel] [RfC PATCH 2/3] sdl2: add support for display rendering using opengl.

2015-01-15 Thread Max Reitz
On 2015-01-12 at 07:46, Gerd Hoffmann wrote: 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 tr

Re: [Qemu-devel] [RfC PATCH 2/3] sdl2: add support for display rendering using opengl.

2015-01-15 Thread Gerd Hoffmann
On Do, 2015-01-15 at 12:23 +, Peter Maydell wrote: > On 15 January 2015 at 12:17, Paolo Bonzini wrote: > > Unless we want to support OpenGLES, which doesn't have glBegin/glEnd > > (you need to use vertex buffers IIRC, but I last played with OpenGL in > > 2008...), the old style is still fine.

Re: [Qemu-devel] [RfC PATCH 2/3] sdl2: add support for display rendering using opengl.

2015-01-15 Thread Peter Maydell
On 15 January 2015 at 12:17, Paolo Bonzini wrote: > Unless we want to support OpenGLES, which doesn't have glBegin/glEnd > (you need to use vertex buffers IIRC, but I last played with OpenGL in > 2008...), the old style is still fine. Even the latest OpenGL additions > in GTK+ use glBegin(GL_QUAD

Re: [Qemu-devel] [RfC PATCH 2/3] sdl2: add support for display rendering using opengl.

2015-01-15 Thread Paolo Bonzini
On 15/01/2015 12:15, Gerd Hoffmann wrote: >> How would the opengl 3/4 version of >> > the above would look like? > Ok, scratch that one. Looks like this is a seriously non-trivial update > and my rusty opengl knowledge needs a major update for modern-style > opengl ... Unless we want to support

Re: [Qemu-devel] [RfC PATCH 2/3] sdl2: add support for display rendering using opengl.

2015-01-15 Thread Gerd Hoffmann
Hi, > How would the opengl 3/4 version of > the above would look like? Ok, scratch that one. Looks like this is a seriously non-trivial update and my rusty opengl knowledge needs a major update for modern-style opengl ... cheers, Gerd

Re: [Qemu-devel] [RfC PATCH 2/3] sdl2: add support for display rendering using opengl.

2015-01-12 Thread Gerd Hoffmann
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

Re: [Qemu-devel] [RfC PATCH 2/3] sdl2: add support for display rendering using opengl.

2014-12-12 Thread Max Reitz
On 2014-12-12 at 12:04, Gerd Hoffmann wrote: Hi, +static void sdl2_gl_render_surface(struct sdl2_console *scon) +{ +int gw, gh, ww, wh, stripe; +float sw, sh; +GLuint tex; + +gw = surface_width(scon->surface); +gh = surface_height(scon->surface); +SDL_GetWindowSize(sc

Re: [Qemu-devel] [RfC PATCH 2/3] sdl2: add support for display rendering using opengl.

2014-12-12 Thread Gerd Hoffmann
Hi, > > +static void sdl2_gl_render_surface(struct sdl2_console *scon) > > +{ > > +int gw, gh, ww, wh, stripe; > > +float sw, sh; > > +GLuint tex; > > + > > +gw = surface_width(scon->surface); > > +gh = surface_height(scon->surface); > > +SDL_GetWindowSize(scon->real_wind

Re: [Qemu-devel] [RfC PATCH 2/3] sdl2: add support for display rendering using opengl.

2014-12-11 Thread Max Reitz
On 2014-12-11 at 12:05, Gerd Hoffmann wrote: Add new sdl2-gl.c file, with display rendering functions using opengl. Signed-off-by: Gerd Hoffmann --- include/ui/sdl2.h | 10 ui/Makefile.objs | 4 ++ ui/sdl2-2d.c | 6 +++ ui/sdl2-gl.c | 143 ++

[Qemu-devel] [RfC PATCH 2/3] sdl2: add support for display rendering using opengl.

2014-12-11 Thread Gerd Hoffmann
Add new sdl2-gl.c file, with display rendering functions using opengl. Signed-off-by: Gerd Hoffmann --- include/ui/sdl2.h | 10 ui/Makefile.objs | 4 ++ ui/sdl2-2d.c | 6 +++ ui/sdl2-gl.c | 143 ++ ui/sdl2.c | 50 +