← Back to team overview

compiz team mailing list archive

[Bug 755841]

 

Updated tester:


#include <GL/gl.h>
#include <SDL/SDL.h>
#include <strings.h>
#include <stdio.h>

int main(int argc, char **argv) {
  Uint32 i, mode, w, h;

  if (argc != 2)
    goto usage;

  SDL_Init(SDL_INIT_VIDEO);

  if (strcmp(argv[1], "w") == 0) {
    mode = SDL_OPENGL;
    w = 800;
    h = 600;
  } else if (strcmp(argv[1], "f") == 0) {
    mode = SDL_OPENGL | SDL_FULLSCREEN;
    const SDL_VideoInfo *info = SDL_GetVideoInfo();
    w = info->current_w;
    h = info->current_h;
    printf("Setting %dx%d fullscreen mode\n", w, h);
  } else {
    goto usage;
  }

  SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1);
  SDL_SetVideoMode(w, h, 32, mode);

  for (i = 0; i < 100; i++) {
    glClearColor(1, 1, 1, 1);
    glClear(GL_COLOR_BUFFER_BIT);
    SDL_GL_SwapBuffers();
    glClearColor(0, 0, 0, 1);
    glClear(GL_COLOR_BUFFER_BIT);
    SDL_GL_SwapBuffers();
  }
  return EXIT_SUCCESS;

usage:
  printf("Usage: %s [w|f]\n", argv[0]);
  return EXIT_FAILURE;
}

// Compile with gcc test-gl.c -o test-gl -lSDL -lGL

-- 
You received this bug notification because you are a member of compiz
packagers, which is subscribed to compiz in Ubuntu.
https://bugs.launchpad.net/bugs/755841

Title:
  [sandybridge] Graphics tearing when playing video

To manage notifications about this bug go to:
https://bugs.launchpad.net/compiz-core/+bug/755841/+subscriptions