Allegro5 - openGL:失败请求的主要操作码:55(X_CreateGC)

时间:2011-07-14 22:20:30

标签: c++ allegro5

我一直在努力让Allegro5在我的Ubuntu机器上运行。我编译了这段代码:

#include <stdio.h>
#include <allegro5/allegro.h>

int main(int argc, char **argv)
{
  ALLEGRO_DISPLAY *display = NULL;
  if (!al_init()) {
    fprintf(stderr, "failed to initialize allegro!\n");
    return -1;
  }

  display = al_create_display(640, 480);

  if (!display) {
    fprintf(stderr, "failed to create display!\n");
    return -1;
  }

  al_clear_to_color(al_map_rgb(0,0,0));
  al_flip_display();
  al_rest(10.0);
  al_destroy_display(display);
  return 0;
}

收到此错误:

X Error of failed request:  BadDrawable (invalid Pixmap or Window parameter)
  Major opcode of failed request:  55 (X_CreateGC)
  Resource id in failed request:  0x4000002
  Serial number of failed request:  25
  Current serial number in output stream:  27

试过这个解决方案: http://www.allegro.cc/forums/thread/607530 (将allegro5.cfg更改为“config_selection = old”并安装了mesa-utils)。

我不确定现在要尝试什么。

1 个答案:

答案 0 :(得分:0)

配置xorg.conf以使用dri和glx。