ia64/xen-unstable

changeset 17272:7d8892a90c90

ioemu: fix sdl opengl rendering
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Mar 19 14:13:17 2008 +0000 (2008-03-19)
parents 3e5973ab442a
children c927f758fcba
files tools/ioemu/sdl.c
line diff
     1.1 --- a/tools/ioemu/sdl.c	Wed Mar 19 14:12:12 2008 +0000
     1.2 +++ b/tools/ioemu/sdl.c	Wed Mar 19 14:13:17 2008 +0000
     1.3 @@ -110,7 +110,7 @@ static void opengl_setdata(DisplayState 
     1.4              glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
     1.5              break;
     1.6      }   
     1.7 -    glPixelStorei(GL_UNPACK_ROW_LENGTH, (ds->linesize * 8 / ds->depth) - ds->width);
     1.8 +    glPixelStorei(GL_UNPACK_ROW_LENGTH, (ds->linesize * 8) / ds->depth);
     1.9      glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, gl_format, ds->width, ds->height, 0, tex_format, tex_type, pixels);
    1.10      glTexParameterf(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_PRIORITY, 1.0);
    1.11      glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    1.12 @@ -125,7 +125,7 @@ static void opengl_update(DisplayState *
    1.13      int bpp = ds->depth / 8;
    1.14      GLvoid *pixels = ds->data + y * ds->linesize + x * bpp;
    1.15      glBindTexture(GL_TEXTURE_RECTANGLE_ARB, texture_ref);
    1.16 -    glPixelStorei(GL_UNPACK_ROW_LENGTH, (ds->linesize / bpp) - w);
    1.17 +    glPixelStorei(GL_UNPACK_ROW_LENGTH, ds->linesize / bpp);
    1.18      glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, x, y, w, h, tex_format, tex_type, pixels);
    1.19      glBegin(GL_QUADS);
    1.20          glTexCoord2d(0, 0);
    1.21 @@ -476,7 +476,8 @@ static void sdl_send_mouse_event(int dx,
    1.22  static void toggle_full_screen(DisplayState *ds)
    1.23  {
    1.24      gui_fullscreen = !gui_fullscreen;
    1.25 -    sdl_resize(ds, screen->w, screen->h, ds->linesize);
    1.26 +    sdl_resize(ds, ds->width, ds->height, ds->linesize);
    1.27 +    ds->dpy_setdata(ds, ds->data);
    1.28      if (gui_fullscreen) {
    1.29          gui_saved_grab = gui_grab;
    1.30          sdl_grab_start();
    1.31 @@ -503,7 +504,7 @@ static void sdl_refresh(DisplayState *ds
    1.32      while (SDL_PollEvent(ev)) {
    1.33          switch (ev->type) {
    1.34          case SDL_VIDEOEXPOSE:
    1.35 -            sdl_update(ds, 0, 0, ds->width, ds->height);
    1.36 +            ds->dpy_update(ds, 0, 0, ds->width, ds->height);
    1.37              break;
    1.38          case SDL_KEYDOWN:
    1.39          case SDL_KEYUP: