Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/allpy/diff/61e5d8e146c7/sandbox/gl.py
Дата изменения: Unknown
Дата индексирования: Wed Feb 27 20:37:34 2013
Кодировка:
allpy: sandbox/gl.py diff

allpy

diff sandbox/gl.py @ 806:61e5d8e146c7

WARNING! Changed EOL formatting to UNIX everywhere! WARNING! To avoid such nasty commits in the future, add the following lines to your ~/.hgrc: [extensions] hgext.eol = Note: kodomo has this setting on by default. Please also note .hgeol file, that has rules for EOL conversion.
author Daniil Alexeyevsky <dendik@kodomo.fbb.msu.ru>
date Thu, 14 Jul 2011 14:28:32 +0400
parents e3ba4c63e622
children
line diff
     1.1 --- a/sandbox/gl.py	Thu Jul 14 14:05:39 2011 +0400
     1.2 +++ b/sandbox/gl.py	Thu Jul 14 14:28:32 2011 +0400
     1.3 @@ -1,46 +1,46 @@
     1.4 -#!/usr/bin/python
     1.5 -# http://disruption.ca/gutil/example3/example3a.html
     1.6 -# vim: set noet:
     1.7 -
     1.8 -import gutil
     1.9 -import pygame
    1.10 -from pygame.locals import *
    1.11 -from OpenGL.GL import *
    1.12 -
    1.13 -from Image import Image
    1.14 -
    1.15 -
    1.16 -def main():
    1.17 -	pygame.init()
    1.18 -	gutil.initializeDisplay(800, 600)
    1.19 -
    1.20 -	done = False
    1.21 -
    1.22 -	cow = Image('cow')
    1.23 -	alien = Image('alien')
    1.24 -
    1.25 -	white = (255,255,255,255)
    1.26 -	stringTex, w, h, tw, th = gutil.loadText("Cow!", color=white)
    1.27 -	stringDL = gutil.createTexDL(stringTex, tw, th)
    1.28 -
    1.29 -	while not done:
    1.30 -		glClear(GL_COLOR_BUFFER_BIT)
    1.31 -		glLoadIdentity()
    1.32 -		glColor4f(1.0,1.0,1.0,1.0)
    1.33 -		glTranslatef(100, 400, 0)
    1.34 -		glCallList(stringDL)
    1.35 -
    1.36 -		cow.draw(pos=(100,100),width=128,height=128)
    1.37 -		alien.draw(pos=(400, 400),rotation=-15,color=(.9,.3,.2,1))
    1.38 -
    1.39 -
    1.40 -		pygame.display.flip()
    1.41 -
    1.42 -		eventlist = pygame.event.get()
    1.43 -		for event in eventlist:
    1.44 -			if event.type == QUIT \
    1.45 -			   or event.type == KEYDOWN and event.key == K_ESCAPE:
    1.46 -				done = True
    1.47 -
    1.48 -if __name__ == '__main__':
    1.49 -	main()
    1.50 +#!/usr/bin/python
    1.51 +# http://disruption.ca/gutil/example3/example3a.html
    1.52 +# vim: set noet:
    1.53 +
    1.54 +import gutil
    1.55 +import pygame
    1.56 +from pygame.locals import *
    1.57 +from OpenGL.GL import *
    1.58 +
    1.59 +from Image import Image
    1.60 +
    1.61 +
    1.62 +def main():
    1.63 +	pygame.init()
    1.64 +	gutil.initializeDisplay(800, 600)
    1.65 +
    1.66 +	done = False
    1.67 +
    1.68 +	cow = Image('cow')
    1.69 +	alien = Image('alien')
    1.70 +
    1.71 +	white = (255,255,255,255)
    1.72 +	stringTex, w, h, tw, th = gutil.loadText("Cow!", color=white)
    1.73 +	stringDL = gutil.createTexDL(stringTex, tw, th)
    1.74 +
    1.75 +	while not done:
    1.76 +		glClear(GL_COLOR_BUFFER_BIT)
    1.77 +		glLoadIdentity()
    1.78 +		glColor4f(1.0,1.0,1.0,1.0)
    1.79 +		glTranslatef(100, 400, 0)
    1.80 +		glCallList(stringDL)
    1.81 +
    1.82 +		cow.draw(pos=(100,100),width=128,height=128)
    1.83 +		alien.draw(pos=(400, 400),rotation=-15,color=(.9,.3,.2,1))
    1.84 +
    1.85 +
    1.86 +		pygame.display.flip()
    1.87 +
    1.88 +		eventlist = pygame.event.get()
    1.89 +		for event in eventlist:
    1.90 +			if event.type == QUIT \
    1.91 +			   or event.type == KEYDOWN and event.key == K_ESCAPE:
    1.92 +				done = True
    1.93 +
    1.94 +if __name__ == '__main__':
    1.95 +	main()