Pygame测试失败,因为找不到OpenGL

时间:2019-01-10 07:16:26

标签: python ubuntu opengl pygame

我正在尝试在Ubuntu 18.04上安装名为don't take it personally, babe, it just ain't your story的游戏。运行启动脚本时,我得到:

File "/home/noname/Desktop/don't take it personally, babe-1.1-linux-x86/renpy/bootstrap.py", line 279, in bootstrap
renpy.main.main()

File "/home/noname/Desktop/don't take it personally, babe-1.1-linux-x86/renpy/main.py", line 309, in main
renpy.display.core.Interface()

File "/home/noname/Desktop/don't take it personally, babe-1.1-linux-x86/renpy/display/core.py", line 1130, in __init__
pygame.display.init()

error: No available video device

我通过python -m pip install -U pygame --user安装了pygame。然后,为了测试pygame,我发现了这个(SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk python -m pygame.tests),它提供了以下输出:

ERROR: test_image_save_works_with_opengl_surfaces (pygame.tests.image__save_gl_surface_test.GL_ImageSave) |tags:display,slow,opengl|

----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/noname/.local/lib/python2.7/site-packages/pygame/tests/image__save_gl_surface_test.py", line 29, in test_image_save_works_with_opengl_surfaces
screen = pygame.display.set_mode((640,480), OPENGL|DOUBLEBUF)
error: OpenGL not available

运行glxinfo | grep "OpenGL"会产生:

OpenGL version string: 3.0 Mesa 18.0.5

我只是想玩这个游戏而迷路了:'(.。请帮忙!

1 个答案:

答案 0 :(得分:0)

SDL_VIDEODRIVER=dummy表示“将所有与视频相关的内容替换为无操作,不产生输出”,这也意味着没有创建OpenGL上下文。如果要测试程序的图形部分,则不是最佳选择。不要覆盖视频驱动程序,它应该可以工作。

相关问题