Answers for "how to draw a single pixel in pyglet"

0

how to draw a single pixel in pyglet

# 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))
        )
Posted by: Guest on March-25-2021

Python Answers by Framework

Browse Popular Code Answers by Language