def __init__(self, width=None, height=None): self.x = 0 self.y = 0 self.view = {} self.color = color(255, 255, 255) if (width == None and height == None): self.bmp = None self.width = width self.height = height else: self.glCreateWindow(width, height)
def glColor(self, r, g, b): self.color = color(floor(r * 255), floor(g * 255), floor(b * 255))
def glColorC(self, r, g, b): self.color = color(r, g, b)
def glClearColor(self, r, g, b): for i in range(self.height): for j in range(self.width): self.bmp.point( i, j, color(trunc(r * 255), trunc(g * 255), trunc(b * 255)))
def glDrawBackground(self, image): bg = Texture(image) for x in range(self.bitmap.width): for y in range(self.bitmap.height): self.bitmap.framebuffer[y][x] = color(*bg.pixels[y][x])