Skip to content

Commit 47bd596

Browse files
committed
Обновлен модуль PyOpenGLHelloWorld:
* Добавление описания * Рефакторинг Signed-off-by: Ilya Petrash <[email protected]>
1 parent 4c99386 commit 47bd596

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

PyOpenGLExample/PyOpenGLHelloWorld.py

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,40 @@
22
from OpenGL.GLUT import *
33
from OpenGL.GLU import *
44

5+
6+
"""
7+
A hello world application
8+
9+
This pages creates a simple window to which 2d orthogonal projection is applied.
10+
Next a couple of points are drawn. This will create a white window with three black
11+
dots.
12+
13+
url = http://www.de-brauwer.be/wiki/wikka.php?wakka=PyOpenGLHelloWorld
14+
"""
15+
16+
517
def initFun():
6-
glClearColor(1.0,1.0,1.0,0.0)
7-
glColor3f(0.0,0.0, 0.0)
18+
glClearColor(1.0, 1.0, 1.0, 0.0)
19+
glColor3f(0.0, 0.0, 0.0)
820
glPointSize(4.0)
921
glMatrixMode(GL_PROJECTION)
1022
glLoadIdentity()
11-
gluOrtho2D(0.0,640.0,0.0,480.0)
12-
23+
gluOrtho2D(0.0, 640.0, 0.0, 480.0)
24+
1325

1426
def displayFun():
1527
glClear(GL_COLOR_BUFFER_BIT)
1628
glBegin(GL_POINTS)
17-
glVertex2i(100,50)
18-
glVertex2i(100,130)
19-
glVertex2i(150,130)
29+
glVertex2i(100, 50)
30+
glVertex2i(100, 130)
31+
glVertex2i(150, 130)
2032
glEnd()
2133
glFlush()
2234

35+
2336
if __name__ == '__main__':
2437
glutInit()
25-
glutInitWindowSize(640,480)
38+
glutInitWindowSize(640, 480)
2639
glutCreateWindow(b"Drawdots")
2740
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB)
2841
glutDisplayFunc(displayFun)

0 commit comments

Comments
 (0)