forked from bitcraft/pyglet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDESIGN
84 lines (64 loc) · 3.13 KB
/
DESIGN
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
The modules
-----------
Core modules (required by all others):
pyglet.GL, pyglet.GLU
OpenGL, including all extensions and versions to 2.0. This is a very
lightweight wrap, and requires knowledge of ctypes to use. An application
developer writing an OpenGL application would want to use PyOpenGL or
OpenGL-ctypes instead, but pyglet itself only uses this (mixing and
matching is no problem).
pyglet.shader
Shader management goes here. Might also have some shaders.
pyglet.window
Interface for opening one or more windows with an OpenGL context, and
receiving and processing events on those windows. GL contexts can
be separate, shared textures/lists or shared state between windows
(separate is default). Include AGL, GLX, WGL and respective extensions.
pyglet.clock
High-resolution timing, frames-per-second calculation (and display?)
and framerate limiting.
pyglet.image
Load and save PNG. Load DXT. Load and save JPEG.
Images as both bitmaps and textures.
:Image: raw image data with attributes width, height, bpp
:TextureOptions: as per blur.py
:Texture: single image as texture with width, height, draw()
:TextureAtlas: split a large texture into a grid of subtextures
{row, col: Texture}, draw(row, col)
:PackedTexture: pack many texture images as subtextures
{name: Texture}
:RenderBuffer: as per blur.py
Allowing texture etc. creation from PIL images should be possible.
Optional modules, in approximate increasing pieness of sky:
pyglet.font
Rendering and layout of fonts, using Freetype, Windows and OS X for
rasterisation. Includes the Bitstream family of fonts.
Basic interface will have:
:Font: a font file
:Glyph: describes a glyph from the font
:Text: encapsulates a set of Glpyhs in a display list and
incorporates kerning in the glyph positioning
Rendering will be done to a texture. We should try to pack >1 rendered
glyph into a texture. Possibly pre-render the ASCII or latin-1 characters
when the font is loaded? Possibly just use PackedTexture?
pyglet.draw
Draw ellipses, polygons, rectangles (using GLU?).
pyglet.scene2d (alternate name suggestions welcome)
2D sprites with collision detection, square and hexagon tile maps. A
level editor. Suitable for side-scrolling, top-down, isometric or
flat 3d rendered games. BTree.
pyglet.scene3d (alternate name suggestions welcome)
OBJ (and other formats?) model loading. Models are readily modifiable
for vertex weighting, edge extraction (volume shadowing), binormal
calculations, etc. Scene of objects, lights and camera. Abstract mechanism
for frustum culling and collision detection. A scene editor. Octree,
possibly BSP.
pyglet.euclid (alternate name suggestions welcome)
2D and 3D vectors, matrices, quaternions and primitives such as sphere,
circle, line, ray, plane, etc. Collision detection and simple resolution.
pyglet.audio
Load, mix and play Wave and MP3 (minimum, more formats better) using
gstreamer, DirectAudio, Windows Media Player, Quicktime, CoreAudio, etc.
3D positional sound?
pyglet.joystick
Include force feedback.