0

我正在尝试通过 python arcade 绘制一个简单的圆圈。但是有一些像这样的错误..

arcade.draw_circle_filled(x, y, radius, arcade.color.YELLOW)
  File "C:\Python38-32\lib\site-packages\arcade\draw_commands.py", line 240, in draw_circle_filled
    draw_ellipse_filled(center_x, center_y, width, height, color, num_segments=num_segments)
  File "C:\Python38-32\lib\site-packages\arcade\draw_commands.py", line 307, in draw_ellipse_filled
    _generic_draw_line_strip(point_list, color, gl.GL_TRIANGLE_FAN)
  File "C:\Python38-32\lib\site-packages\arcade\draw_commands.py", line 410, in _generic_draw_line_strip
    program = shader.program(
  File "C:\Python38-32\lib\site-packages\arcade\shader.py", line 220, in program
    return Program(
  File "C:\Python38-32\lib\site-packages\arcade\shader.py", line 110, in __init__
    shader = compile_shader(shader_code, shader_type)
  File "C:\Python38-32\lib\site-packages\arcade\shader.py", line 252, in compile_shader
    raise ShaderException(
arcade.shader.ShaderException: Shader compile failure (0): ERROR: 0:2: '' :  Version number not supported by OGL driver
ERROR: 0:4: 'in' :  supported in GLSL 1.30 or later 
ERROR: 0:5: 'in' :  supported in GLSL 1.30 or later 
ERROR: 0:6: 'out' :  supported in GLSL 1.30 or later
4

1 回答 1

0

如果您提供代码,答案会容易得多。所以基本上我会给出一个简单的画圆程序的例子。顺便说一句,这个网站:https ://opensource.com/article/18/4/easy-2d-game-creation-python-and-arcade对于使用 python 街机开发街机游戏非常有用。

可能是您还没有打开街机窗口。不要从 shell 运行街机命令。

import arcade
#initialize
SCREEN_HEIGHT = 600 #replace with wanted screen height
SCREEN_WIDTH = 600 #REPLACE ALSO
arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, "Drawing a Circle")
arcade.set_background_color(arcade.color.WHITE)

# Start the render process. This must be done before any drawing commands.
arcade.start_render()

# Draw the circle
x = 300
y = 300
radius = 200
arcade.draw_circle_filled(x, y, radius, arcade.color.YELLOW)
于 2020-07-06T08:32:48.697 回答