-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_py3.py
59 lines (57 loc) · 1.58 KB
/
test_py3.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from pyirrlicht import EDT_SOFTWARE, pyirrlicht_version, dimension2du, createDevice, SColor
def test():
print('pyirrlicht version =', pyirrlicht_version)
print('=' * 20)
device = createDevice(EDT_SOFTWARE, dimension2du(320, 240))
if device:
try:
print('Irrlicht Version', device.getVersion())
except Exception as e:
print(e)
try:
device.setWindowCaption('Irrlicht Engine Window')
except Exception as e:
print(e)
print('=' * 20)
try:
video_driver = device.getVideoDriver()
except Exception as e:
print(e)
else:
print('video_driver', video_driver)
print('name video_driver', video_driver.getName())
print('VendorInfo video_driver', video_driver.getVendorInfo())
print('=' * 20)
try:
scene_manager = device.getSceneManager()
except Exception as e:
print(e)
else:
print('scene_manager', scene_manager)
print('=' * 20)
try:
gui_environment = device.getGUIEnvironment()
except Exception as e:
print(e)
else:
print('gui_environment', gui_environment)
device.setResizable(True)
print('=' * 20)
color = SColor(255,100,100,140)
print('color argb', color.getAlpha(), color.getRed(), color.getGreen(), color.getBlue())
print('=' * 20)
while device.run():
if device.isWindowActive():
video_driver.beginScene(True, True, color)
scene_manager.drawAll()
gui_environment.drawAll()
video_driver.endScene()
device.sleep(50)
else:
device._yield()
device.closeDevice()
device.drop()
else:
print('ERROR createDevice')
if __name__ == "__main__":
test()