📜  如何在 pyglet 中绘制单个像素 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:55.892000             🧑  作者: Mango

代码示例1
# this works but it takes FOREVER
# 50 by 50 square going from black to white
for i in range(50):
    for j in range(50):
        color = int(2.56 * (i + j))
        pyglet.graphics.draw(1, pyglet.gl.GL_POINTS,
            ('v2i', (i, j)),
            ('c3B', (color, color, color))
        )