X-Git-Url: http://git.hcoop.net/clinton/guile-figl.git/blobdiff_plain/57a309e7ab19b5326d3072135fe869ef8016d005..13027b2dbc5b77e5906584aefc2fc9f16047e471:/TODO diff --git a/TODO b/TODO index d14ff60..f6a9294 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,24 @@ # -*- org -*- +Copyright (C) 2013 Andy Wingo +Copyright (C) 2013 Daniel Hartwig + +This document is part of Figl. + +Figl is free software; you can redistribute it and/or modify it +under the terms of the GNU Lesser General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +Figl is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General +Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this document. If not, see +. + * Completeness ** Complete the high-level GL binding. @@ -37,6 +56,98 @@ interfaces to reuse the low-level bindings. There is a wip-egl branch with upstream documentation. +** Packed structures. + +To facilitate passing data to buffer objects. Rather than dealing +with bytevectors, offsets, and strides directly, we can use a +packed-struct. and field pair to compute the arguments for +vertex-pointer and friends (size, type, stride, and pointer). + +Existing work: + +- make-structure-descriptor (r7rs-large): + http://trac.sacrideo.us/wg/wiki/StructuresCowan + + : (define-structure my-vertex-type + : (position 'f32 3 position-ref position-set!) + : (normal 'f32 3 normal-ref normal-set!) + : (color 'u8 4 color-ref color-set!) + : (non-gl-data 'f32 2)) + : (define foo (list->structure my-vertex-type ...)) + : ;; (set-vertex-pointer FIELD BV) + : (set-vertex-pointer position foo) + : (set-color-pointer color foo) + : ;; position, normal, etc. are identifiers bound to the required + : ;; field specs. by the define-structure expression. + +- define-gl-array-format (cl-opengl): + + Specifically maps each component to an OpenGL array type (one of + vertex, color, normal, ...). This permits automatically binding an + entire structure to the relevent array pointers. + + Additional per-component options include: + - named access to sub-components (e.g. vertex x, y, z); + - whether values are normalized on assignment. + +* Interface + +** Implement rest of spec parsing module. + +To parse functions (gl.spec, etc.), enums, and typemaps. + +** Do not export meta-enumerations (version-2-1, etc.). + +These are listed in the “Extensions” definition (enum.spec) and are +defined only to indicate the version or extension that introduces +various symbolic constants. In theory, all useful constants that +appear in version-2-1, for example, also appear in at least one other +enumeration which is an actual data type as referred to by gl.spec. + +They can still be used to provide versioned interfaces and profiles, +there is just no need to export them as enumerations at run time. + +Need to make sure all required symbolic constants will still be +accessible before removing these. + +** Make using enumerations implicit. + +Instead of: + +: (gl-begin (begin-mode triangles) ...) +: (gl-matrix-mode) => 123 + +more like this: + +: (gl-begin #:triangles ...) +: (gl-matrix-mode) => #:modelview + +and lists of symbols for bitfields. + +Enumeration type checking (i.e. does gl-begin accept #:foo?) can be +done two ways. + +*** Type checking by Guile. + +Before this can be done we must parse gl.spec to know which enums to +apply for each procedure argument. _Probably_ foreign-types can no +longer be syntax either. + +Requires also some manual overriding and mapping as there is some +inconsistency between gl.spec, gl.tm, and enum.spec. For example, +gl.spec occasionally refers to an enumeration type that is not listed +in enum.spec, or is listed under another name. + +*** Type checking by GL. + +Most GL procedures already check the range of enum and bitfield +arguments, and flag an invalid-enum error as appropriate. We can rely +on this and create a single, super-enumeration to convert to and from +symbols. + +This may incur a notable performance hit due to the large number of +symbolic constants. + * Naming ** Mangle low-level binding names. @@ -46,15 +157,14 @@ enough. In practice this means that output arguments should be natively supported, and they low-level bindings should check errors as appropriate. -** TODO Document the naming convention. :wigs: +** TODO Document the naming convention. Specifically we should document when a name changes significantly, like when to use a "set-" prefix and the abbreviation expansions ("accum" -> "accumulation-buffer", "coord" -> "coordinates"). Getting this done early will permit implementing the policy more -accurately. Marking TODO and will work on a draft covering the -conventions I have used/intend to use soon. +accurately. ** Maybe drop the "gl-" prefix for high-level bindings.