add packed structures to TODO
[clinton/guile-figl.git] / TODO
1 # -*- org -*-
2
3 * Completeness
4
5 ** Complete the high-level GL binding.
6
7 *** Bind newer versions.
8
9 Would be nice to bind newer versions as well, while keeping the
10 compatibility profile.
11
12 The newer versions are backwards compatible with only rare exceptions
13 where some function's behaviour (but not prototype) is subtley
14 redefined. To support newer versions in a simple way we can export
15 all bindings and the user effectively chooses which version they use
16 by their choice of procedures.
17
18 Exporting particular profiles is a nice addition to this.
19
20 ** Complete the high-level GLU binding.
21
22 ** Complete the high-level GLX binding.
23
24 ** Complete the high-level GLUT binding.
25
26 *** Do not keep alive callback pointers indefinitely.
27
28 Perhaps by moving the gc-protect mechanism to the high-level bindings,
29 and track which callbacks are active on each window and globally.
30
31 Users of the low-level bindings can still use the foo-callback-*
32 helpers, but must assume control of pointer lifetime. Such an
33 approach permits great flexibility for alternative high-level
34 interfaces to reuse the low-level bindings.
35
36 ** Write an EGL binding.
37
38 There is a wip-egl branch with upstream documentation.
39
40 ** Packed structures.
41
42 To facilitate passing data to buffer objects. Rather than dealing
43 with bytevectors, offsets, and strides directly, we can use a
44 packed-struct. and field pair to compute the arguments for
45 vertex-pointer and friends (size, type, stride, and pointer).
46
47 Existing work:
48
49 - make-structure-descriptor (r7rs-large):
50 http://trac.sacrideo.us/wg/wiki/StructuresCowan
51
52 : (define-structure my-vertex-type
53 : (position 'f32 3 position-ref position-set!)
54 : (normal 'f32 3 normal-ref normal-set!)
55 : (color 'u8 4 color-ref color-set!)
56 : (non-gl-data 'f32 2))
57 : (define foo (list->structure my-vertex-type ...))
58 : ;; (set-vertex-pointer FIELD BV)
59 : (set-vertex-pointer position foo)
60 : (set-color-pointer color foo)
61 : ;; position, normal, etc. are identifiers bound to the required
62 : ;; field specs. by the define-structure expression.
63
64 - define-gl-array-format (cl-opengl):
65
66 Specifically maps each component to an OpenGL array type (one of
67 vertex, color, normal, ...). This permits automatically binding an
68 entire structure to the relevent array pointers.
69
70 Additional per-component options include:
71 - named access to sub-components (e.g. vertex x, y, z);
72 - whether values are normalized on assignment.
73
74 * Naming
75
76 ** Mangle low-level binding names.
77
78 Probably we should do this only if this low-level bindings are good
79 enough. In practice this means that output arguments should be natively
80 supported, and they low-level bindings should check errors as
81 appropriate.
82
83 ** TODO Document the naming convention. :wigs:
84
85 Specifically we should document when a name changes significantly,
86 like when to use a "set-" prefix and the abbreviation expansions
87 ("accum" -> "accumulation-buffer", "coord" -> "coordinates").
88
89 Getting this done early will permit implementing the policy more
90 accurately. Marking TODO and will work on a draft covering the
91 conventions I have used/intend to use soon.
92
93 ** Maybe drop the "gl-" prefix for high-level bindings.
94
95 The names for most gl, glu, etc. procedures are unique enough to not
96 conflict with each other, and most Scheme names generally. Removing
97 the prefix will make names where an additional prefix is used (such as
98 "set-") much more natural.
99
100 Users with specific namespace concerns can use selective and renaming
101 imports.
102
103 * Documentation
104
105 ** Figure out how to incorporate low-level bindings into the
106 documentation.
107
108 Often-times the high-level bindings just duplicate information from the
109 low-level bindings, but poorly. To do this, we'd have to make a map of
110 how to organize the low-level bindings, probably according to their
111 section in the specification.
112
113 ** Mangle enumeration names to link to the enumerator documentation.
114
115 ** Give an @anchor{} to each API element so that we can link back and
116 forth.
117
118 * Examples
119
120 ** examples/README explaining the layout.
121
122 ** OpenGL standards.
123
124 Language bindings typically provide ports of the standard examples, to
125 demonstrate usage patterns and their own unique style.
126
127 http://www.sgi.com/products/software/opengl/examples/index.html
128
129 Implement at least a few of these, their licencing is permissive
130 enough and they have been widely ported to Free Software language
131 bindings already.
132
133 ** More interesting demos.
134
135 * Meta
136
137 ** Mailing list?
138
139 ** Web page for documentation?
140
141 Both of these point towards hosting on savannah at some point. Figl
142 could become a GNU project but it will not have copyright assignment.