My favorites | Sign in
Project Home Downloads Wiki Issues Source
Repository:
Checkout   Browse   Changes   Clones  
Changes to /DESIGN
65e0db6394d3 vs. 0f8412b37701 Compare: vs.  Format:
Revision 0f8412b37701
Go to: 
Sign in to write a code review
/DESIGN   65e0db6394d3 /DESIGN   0f8412b37701
1 Principles 1 Principles
2 ---------- 2 ----------
3 3
4 * pyglet is an umbrella framework for games, multimedia and graphics 4 * pyglet is an umbrella framework for games, multimedia and graphics
5 applications written in Python. 5 applications written in Python.
6 * No required dependencies where possible. Instead, core services provided 6 * No required dependencies where possible. Instead, core services provided
7 by Windows, OS X and X11 are used. Some exceptions will have to apply (see 7 by Windows, OS X and X11 are used. Some exceptions will have to apply (see
8 below) 8 below)
9 * It is not a game engine. It's a set of modules that might be helpful, 9 * It is not a game engine. It's a set of modules that might be helpful,
10 and happen to work well together. 10 and happen to work well together.
11 * Not a single monolithic download. Use .eggs to bundle related functionality 11 * Not a single monolithic download. Use .eggs to bundle related functionality
12 (core, audio, 2d, 3d, ...) 12 (core, audio, 2d, 3d, ...)
13 13
14 14
15 The modules 15 The modules
16 ----------- 16 -----------
17 17
18 Core modules (required by all others): 18 Core modules (required by all others):
19 19
20 pyglet.GL, pyglet.GLU 20 pyglet.GL, pyglet.GLU
21 OpenGL, including all extensions and versions to 2.0. This is a very 21 OpenGL, including all extensions and versions to 2.0. This is a very
22 lightweight wrap, and requires knowledge of ctypes to use. An application 22 lightweight wrap, and requires knowledge of ctypes to use. An application
23 developer writing an OpenGL application would want to use PyOpenGL or 23 developer writing an OpenGL application would want to use PyOpenGL or
24 OpenGL-ctypes instead, but pyglet itself only uses this (mixing and 24 OpenGL-ctypes instead, but pyglet itself only uses this (mixing and
25 matching is no problem). 25 matching is no problem).
26 26
27 pyglet.shader 27 pyglet.shader
28 Shader management goes here. Might also have some shaders. 28 Shader management goes here. Might also have some shaders.
29 29
30 pyglet.window 30 pyglet.window
31 Interface for opening one or more windows with an OpenGL context, and 31 Interface for opening one or more windows with an OpenGL context, and
32 receiving and processing events on those windows. GL contexts can 32 receiving and processing events on those windows. GL contexts can
33 be separate, shared textures/lists or shared state between windows 33 be separate, shared textures/lists or shared state between windows
34 (separate is default). Include AGL, GLX, WGL and respective extensions. 34 (separate is default). Include AGL, GLX, WGL and respective extensions.
35 35
36 pyglet.clock 36 pyglet.clock
37 High-resolution timing, frames-per-second calculation (and display?) 37 High-resolution timing, frames-per-second calculation (and display?)
38 and framerate limiting. 38 and framerate limiting.
39 39
40 pyglet.image 40 pyglet.image
41 Load and save PNG. Load DXT. Load and save JPEG. 41 Load and save PNG. Load DXT. Load and save JPEG.
42 Images as both bitmaps and textures. 42 Images as both bitmaps and textures.
43 43
44 :Image: raw image data with attributes width, height, bpp 44 :Image: raw image data with attributes width, height, bpp
45 :TextureOptions: as per blur.py 45 :TextureOptions: as per blur.py
46 :Texture: single image as texture with width, height, draw() 46 :Texture: single image as texture with width, height, draw()
47 :TextureAtlas: split a large texture into a grid of subtextures 47 :TextureAtlas: split a large texture into a grid of subtextures
48 {row, col: Texture}, draw(row, col) 48 {row, col: Texture}, draw(row, col)
49 :PackedTexture: pack many texture images as subtextures 49 :PackedTexture: pack many texture images as subtextures
50 {name: Texture} 50 {name: Texture}
51 :RenderBuffer: as per blur.py 51 :RenderBuffer: as per blur.py
52 52
53 Allowing texture etc. creation from PIL images should be possible. 53 Allowing texture etc. creation from PIL images should be possible.
54 54
55 55
56 Optional modules, in approximate increasing pieness of sky: 56 Optional modules, in approximate increasing pieness of sky:
57 57
58 pyglet.font 58 pyglet.font
59 <ah>: isn't this pyglet.text now?
60
59 Rendering and layout of fonts, using Freetype, Windows and OS X for 61 Rendering and layout of fonts, using Freetype, Windows and OS X for
60 rasterisation. Includes the Bitstream family of fonts. 62 rasterisation. Includes the Bitstream family of fonts.
61 63
62 Basic interface will have: 64 Basic interface will have:
63 65
64 :Font: a font file 66 :Font: a font file
65 :Glyph: describes a glyph from the font 67 :Glyph: describes a glyph from the font
66 :Text: encapsulates a set of Glpyhs in a display list and 68 :Text: encapsulates a set of Glpyhs in a display list and
67 incorporates kerning in the glyph positioning 69 incorporates kerning in the glyph positioning
68 70
69 Rendering will be done to a texture. We should try to pack >1 rendered 71 Rendering will be done to a texture. We should try to pack >1 rendered
70 glyph into a texture. Possibly pre-render the ASCII or latin-1 characters 72 glyph into a texture. Possibly pre-render the ASCII or latin-1 characters
71 when the font is loaded? Possibly just use PackedTexture? 73 when the font is loaded? Possibly just use PackedTexture?
72 74
73 pyglet.gui (requires pyglet.font) 75 pyglet.gui (requires pyglet.font)
74 Buttons, sliders, text entry, scrollable text, menus and lists. Widgets 76 Buttons, sliders, text entry, scrollable text, menus and lists. Widgets
75 can be decorated with a pluggable look-and-feel (useful for quick mockups, 77 can be decorated with a pluggable look-and-feel (useful for quick mockups,
76 level-editors, graphics applications), or with customized images for 78 level-editors, graphics applications), or with customized images for
77 each widget (game interfaces). Widgets can be laid out by pixel coordinates 79 each widget (game interfaces). Widgets can be laid out by pixel coordinates
78 (in an editor?), or with simple layout managers. Transition effects 80 (in an editor?), or with simple layout managers. Transition effects
79 can be applied for buttons sliding on/off screen, fading in/out, rollovers, 81 can be applied for buttons sliding on/off screen, fading in/out, rollovers,
80 crossfading, etc. Command events etc are pushed back through the 82 crossfading, etc. Command events etc are pushed back through the
81 pyglet.window event queue? 83 pyglet.window event queue?
82 84
83 Status elements like progress bars: 85 Status elements like progress bars:
84 86
85 straight horizontal / vertical bars (active/inactive colour) 87 straight horizontal / vertical bars (active/inactive colour)
86 image-based where the image is "filled" (active/inactive image) 88 image-based where the image is "filled" (active/inactive image)
87 89
90 - <ah>: These are the same thing, and should be controlled by look-n-feel
91 object.
92
88 Graphical elements like boxes to put other elements in which have 93 Graphical elements like boxes to put other elements in which have
89 padding, border, margin like CSS box model. 94 padding, border, margin like CSS box model.
90 95
96 - <ah>: Border should be abstracted and controlled by look-n-feel.
97 CSS model possibly too complicated and obfuscated?
98
91 pyglet.draw 99 pyglet.draw
92 Draw ellipses, polygons, rectangles (using GLU?). 100 Draw ellipses, polygons, rectangles (using GLU?).
93 101
94 pyglet.scene2d (alternate name suggestions welcome) 102 pyglet.scene2d (alternate name suggestions welcome)
95 2D sprites with collision detection, square and hexagon tile maps. A 103 2D sprites with collision detection, square and hexagon tile maps. A
96 level editor. Suitable for side-scrolling, top-down, isometric or 104 level editor. Suitable for side-scrolling, top-down, isometric or
97 flat 3d rendered games. BTree. 105 flat 3d rendered games. BTree.
98 106
99 pyglet.scene3d (alternate name suggestions welcome) 107 pyglet.scene3d (alternate name suggestions welcome)
100 OBJ (and other formats?) model loading. Models are readily modifiable 108 OBJ (and other formats?) model loading. Models are readily modifiable
101 for vertex weighting, edge extraction (volume shadowing), binormal 109 for vertex weighting, edge extraction (volume shadowing), binormal
102 calculations, etc. Scene of objects, lights and camera. Abstract mechanism 110 calculations, etc. Scene of objects, lights and camera. Abstract mechanism
103 for frustum culling and collision detection. A scene editor. Octree, 111 for frustum culling and collision detection. A scene editor. Octree,
104 possibly BSP. 112 possibly BSP.
105 113
106 pyglet.euclid (alternate name suggestions welcome) 114 pyglet.euclid (alternate name suggestions welcome)
107 2D and 3D vectors, matrices, quaternions and primitives such as sphere, 115 2D and 3D vectors, matrices, quaternions and primitives such as sphere,
108 circle, line, ray, plane, etc. Collision detection and simple resolution. 116 circle, line, ray, plane, etc. Collision detection and simple resolution.
109 117
110 pyglet.audio 118 pyglet.audio
111 Load, mix and play Wave and MP3 (minimum, more formats better) using 119 Load, mix and play Wave and MP3 (minimum, more formats better) using
112 gstreamer, DirectAudio, Windows Media Player, Quicktime, CoreAudio, etc. 120 gstreamer, DirectAudio, Windows Media Player, Quicktime, CoreAudio, etc.
113 3D positional sound? 121 3D positional sound?
114 122
115 pyglet.video 123 pyglet.video
116 Play video (e.g., MPEG2) into a texture using gstreamer, Windows Media 124 Play video (e.g., MPEG2) into a texture using gstreamer, Windows Media
117 Player, Quicktime, CoreVideo, etc. 125 Player, Quicktime, CoreVideo, etc.
118 126
119 pyglet.joystick 127 pyglet.joystick
120 Include force feedback. 128 Include force feedback.
121 129
122 pyglet.network 130 pyglet.network
123 Network events handled in a similar manner to window events. Abstracted 131 Network events handled in a similar manner to window events. Abstracted
124 interface to TCP and UDP, similar to nanotubes from FibraNet? 132 interface to TCP and UDP, similar to nanotubes from FibraNet?
125 http://code.google.com/p/fibranet/ 133 http://code.google.com/p/fibranet/
126 134
127 pyglet.ai 135 pyglet.ai
128 A*, state machine, thoughts? (no pun intended) 136 A*, state machine, thoughts? (no pun intended)
129 137
Powered by Google Project Hosting