bind buffer objects
[clinton/guile-figl.git] / TODO
CommitLineData
1a878fcf
AW
1# -*- org -*-
2
3* Completeness
4
5** Complete the high-level GL binding.
6
57a309e7
DH
7*** Bind newer versions.
8
1a878fcf
AW
9Would be nice to bind newer versions as well, while keeping the
10compatibility profile.
11
57a309e7
DH
12The newer versions are backwards compatible with only rare exceptions
13where some function's behaviour (but not prototype) is subtley
14redefined. To support newer versions in a simple way we can export
15all bindings and the user effectively chooses which version they use
16by their choice of procedures.
17
18Exporting particular profiles is a nice addition to this.
19
1a878fcf
AW
20** Complete the high-level GLU binding.
21
22** Complete the high-level GLX binding.
23
24** Complete the high-level GLUT binding.
25
57a309e7
DH
26*** Do not keep alive callback pointers indefinitely.
27
28Perhaps by moving the gc-protect mechanism to the high-level bindings,
29and track which callbacks are active on each window and globally.
30
31Users of the low-level bindings can still use the foo-callback-*
32helpers, but must assume control of pointer lifetime. Such an
33approach permits great flexibility for alternative high-level
34interfaces to reuse the low-level bindings.
35
1a878fcf
AW
36** Write an EGL binding.
37
38There is a wip-egl branch with upstream documentation.
39
ce3c1d57
DH
40** Packed structures.
41
42To facilitate passing data to buffer objects. Rather than dealing
43with bytevectors, offsets, and strides directly, we can use a
44packed-struct. and field pair to compute the arguments for
45vertex-pointer and friends (size, type, stride, and pointer).
46
47Existing 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
da2e2d6f
DH
74* Interface
75
76** Implement rest of spec parsing module.
77
78To parse functions (gl.spec, etc.), enums, and typemaps.
79
80** Do not export meta-enumerations (version-2-1, etc.).
81
82These are listed in the “Extensions” definition (enum.spec) and are
83defined only to indicate the version or extension that introduces
84various symbolic constants. In theory, all useful constants that
85appear in version-2-1, for example, also appear in at least one other
86enumeration which is an actual data type as referred to by gl.spec.
87
88They can still be used to provide versioned interfaces and profiles,
89there is just no need to export them as enumerations at run time.
90
91Need to make sure all required symbolic constants will still be
92accessible before removing these.
93
94** Make using enumerations implicit.
95
96Instead of:
97
98: (gl-begin (begin-mode triangles) ...)
99: (gl-matrix-mode) => 123
100
101more like this:
102
103: (gl-begin #:triangles ...)
104: (gl-matrix-mode) => #:modelview
105
106and lists of symbols for bitfields.
107
108Enumeration type checking (i.e. does gl-begin accept #:foo?) can be
109done two ways.
110
111*** Type checking by Guile.
112
113Before this can be done we must parse gl.spec to know which enums to
114apply for each procedure argument. _Probably_ foreign-types can no
115longer be syntax either.
116
117Requires also some manual overriding and mapping as there is some
118inconsistency between gl.spec, gl.tm, and enum.spec. For example,
119gl.spec occasionally refers to an enumeration type that is not listed
120in enum.spec, or is listed under another name.
121
122*** Type checking by GL.
123
124Most GL procedures already check the range of enum and bitfield
125arguments, and flag an invalid-enum error as appropriate. We can rely
126on this and create a single, super-enumeration to convert to and from
127symbols.
128
129This may incur a notable performance hit due to the large number of
130symbolic constants.
131
1a878fcf
AW
132* Naming
133
134** Mangle low-level binding names.
135
136Probably we should do this only if this low-level bindings are good
137enough. In practice this means that output arguments should be natively
138supported, and they low-level bindings should check errors as
139appropriate.
140
fb44a6aa 141** TODO Document the naming convention.
57a309e7
DH
142
143Specifically we should document when a name changes significantly,
144like when to use a "set-" prefix and the abbreviation expansions
145("accum" -> "accumulation-buffer", "coord" -> "coordinates").
146
147Getting this done early will permit implementing the policy more
fb44a6aa 148accurately.
57a309e7
DH
149
150** Maybe drop the "gl-" prefix for high-level bindings.
1a878fcf 151
57a309e7
DH
152The names for most gl, glu, etc. procedures are unique enough to not
153conflict with each other, and most Scheme names generally. Removing
154the prefix will make names where an additional prefix is used (such as
155"set-") much more natural.
156
157Users with specific namespace concerns can use selective and renaming
158imports.
1a878fcf
AW
159
160* Documentation
161
162** Figure out how to incorporate low-level bindings into the
163 documentation.
164
165Often-times the high-level bindings just duplicate information from the
166low-level bindings, but poorly. To do this, we'd have to make a map of
167how to organize the low-level bindings, probably according to their
168section in the specification.
169
170** Mangle enumeration names to link to the enumerator documentation.
171
172** Give an @anchor{} to each API element so that we can link back and
173 forth.
174
57a309e7
DH
175* Examples
176
177** examples/README explaining the layout.
178
179** OpenGL standards.
180
181Language bindings typically provide ports of the standard examples, to
182demonstrate usage patterns and their own unique style.
183
184http://www.sgi.com/products/software/opengl/examples/index.html
185
186Implement at least a few of these, their licencing is permissive
187enough and they have been widely ported to Free Software language
188bindings already.
189
190** More interesting demos.
191
1a878fcf
AW
192* Meta
193
194** Mailing list?
195
196** Web page for documentation?
197
198Both of these point towards hosting on savannah at some point. Figl
199could become a GNU project but it will not have copyright assignment.