def main(): pygame.init() gutil.initializeDisplay(800, 600) glColor4f(1.0,1.0,1.0,1.0) done = False cowTex, w, h = gutil.loadImage('art/planetcute/Character Boy.png') cow = gutil.createTexDL(cowTex, w, h) alienTex, w, h = gutil.loadImage('art/alien.png') alien = gutil.createTexDL(alienTex, w, h) while not done: glLoadIdentity() glTranslatef(100, 100, 0) glCallList(cow) glTranslatef(400, 400, 0) glCallList(alien) pygame.display.flip() eventlist = pygame.event.get() for event in eventlist: if event.type == QUIT \ or event.type == KEYDOWN and event.key == K_ESCAPE: done = True
def main(): pygame.init() gutil.initializeDisplay(800, 600) glColor4f(1.0, 1.0, 1.0, 1.0) done = False cowTex, w, h = gutil.loadImage('art/planetcute/Character Boy.png') cow = gutil.createTexDL(cowTex, w, h) alienTex, w, h = gutil.loadImage('art/alien.png') alien = gutil.createTexDL(alienTex, w, h) while not done: glLoadIdentity() glTranslatef(100, 100, 0) glCallList(cow) glTranslatef(400, 400, 0) glCallList(alien) pygame.display.flip() eventlist = pygame.event.get() for event in eventlist: if event.type == QUIT \ or event.type == KEYDOWN and event.key == K_ESCAPE: done = True
def __init__(self, text, fontsize = 24, color = (0,0,0,0), font = None, antialias = 1): texttexture = gutil.loadText(text, fontsize, color, font, antialias) self.texture = texttexture[0] self.width = texttexture[1] self.height = texttexture[2] self.texture_width = texttexture[3] self.texture_height = texttexture[4] self.displayList = gutil.createTexDL(self.texture, self.texture_width, self.texture_height)
def __init__(self, texname): filename = os.path.join('data', texname) filename += ".png" self.texture, self.width, self.height = gutil.loadImage(filename) self.displayList = gutil.createTexDL(self.texture, self.width, self.height)