#!/usr/bin/python
# coding: utf-8
from OpenGL.GL import *
from OpenGL.GLUT import *
width = 200
height = 200
rgbdata = ''
for x in range(0, width):
for y in range(0, height):
rgbdata += 'a'
rgbdata += 'x'
rgbdata += '0'
def draw():
glClearColor(1.0, 0.0, 0.0, 0.0)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glRasterPos2i(-1 , -1);
glDrawPixels(width , height , GL_RGB , GL_UNSIGNED_BYTE , rgbdata);
glFlush()
glutSwapBuffers()
glutInit(sys.argv)
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH)
glutInitWindowSize(width, height)
glutCreateWindow("PyOpenGL DrawPixels")
glutDisplayFunc(draw)
glutMainLoop()