clinton/guile-figl.git
11 years agouse pairs in renaming re-exports
Daniel Hartwig [Mon, 11 Feb 2013 00:00:19 +0000 (08:00 +0800)]
use pairs in renaming re-exports

* figl/gl.scm: Use the correct pair syntax, not lists, for renaming
  re-exports.  Remove note about possible Guile bug.

11 years agoadd note about re-export bug
Daniel Hartwig [Sun, 10 Feb 2013 13:53:07 +0000 (21:53 +0800)]
add note about re-export bug

* figl/gl.scm: Note that there appears to be a bug in re-export
  syntax, chase up tomorrow.

11 years agoadd transformation bindings
Daniel Hartwig [Sun, 10 Feb 2013 13:50:15 +0000 (21:50 +0800)]
add transformation bindings

* figl/gl.scm: Add transformation bindings; load-matrix, etc.

11 years agoadd bindings for begin/end and vertex specification
Daniel Hartwig [Sun, 10 Feb 2013 12:31:39 +0000 (20:31 +0800)]
add bindings for begin/end and vertex specification

* figl/gl.scm: Initial work on high-level bindings for begin/end and
  vertex specification.  Choosing to only export unpacked float
  variants at this time.  Refer to inline comments for details.

11 years agouse ptrdiff_t, not guesswork
Daniel Hartwig [Sun, 10 Feb 2013 09:23:10 +0000 (17:23 +0800)]
use ptrdiff_t, not guesswork

* figl/gl/types.scm (GLintptr, GLsizeiptr): Define as ptrdiff_t from
  recent Guile.  Fixed a bug where this was set to an unsigned type.
  Add note that about non-Mesa platforms.

11 years agoarray parameters also accept pointers
Daniel Hartwig [Sun, 10 Feb 2013 09:18:18 +0000 (17:18 +0800)]
array parameters also accept pointers

* figl/gl/types.scm (coerce-array-pointer): Renamed from
  array->pointer.  Also accept pointers, and perhaps typed-arrays in
  the future.  Removed excess lambda.

11 years agorestore type hack for glGetString.xml typo
Daniel Hartwig [Sun, 10 Feb 2013 07:45:33 +0000 (15:45 +0800)]
restore type hack for glGetString.xml typo

* figl/gl/types.scm (const-GLubyte*): Restore this redundant type to
  work around a typo in glGetString.xml.

11 years agorename some glut enums
Daniel Hartwig [Sun, 10 Feb 2013 07:33:00 +0000 (15:33 +0800)]
rename some glut enums

* figl/glut/enums.scm (button-name, layer-name, cursor-name): Renamed
  to be less generic, and more inline with gl enums.

11 years agoupdate low-level docs
Andy Wingo [Sat, 9 Feb 2013 17:11:46 +0000 (18:11 +0100)]
update low-level docs

* doc/low-level-gl.texi: Update docs.  It seems I have some unpushed
  changes to Guile that make Daniel unable to do this.  Sorry about
  that!

11 years agotypo in update-enumerations
Daniel Hartwig [Sat, 9 Feb 2013 10:17:01 +0000 (18:17 +0800)]
typo in update-enumerations

* maint/update-enumerations (write-texi): Insert missing space in
  generated text.

* doc/low-level-gl-enums.texi:
* doc/low-level-glx-enums.texi: Update.

11 years agoinclude all low-level bindings
Daniel Hartwig [Sat, 9 Feb 2013 09:32:03 +0000 (17:32 +0800)]
include all low-level bindings

* figl/parse.scm (parse-prototypes, skip?): Remove the skip? function,
  include all low-level bindings.  In many cases automatic skip is not
  possible, such as glMaterial that requires both packed and unpacked
  variants depending on the parameter.  Some variants are encouraged
  to be optimized (such as glColor3b).  Any low-level consumer can
  decide whether to use packed/unpacked, and what format to store data
  in.  Let the foot shooting commence.

* figl/gl/types.scm: Include more possible type combinations, whether
  used directly by gl or not.

* figl/gl/low-level.scm: Update.

* doc/: Not updated due to problems with line wrapping in texi output.

11 years agoadd remaining glut enumerations
Daniel Hartwig [Sat, 9 Feb 2013 03:39:03 +0000 (11:39 +0800)]
add remaining glut enumerations

* figl/glut/enums.scm: Add remaining.

11 years agoPartially revert "typo fixes in parse.scm"
Daniel Hartwig [Sat, 9 Feb 2013 01:05:19 +0000 (09:05 +0800)]
Partially revert "typo fixes in parse.scm"

This reverts commit 940b3bea6a7d1ac5f388bdb9a402aab94f211f0c.

* figl/parse.scm (string->directions, string->transfer-types): If
  input is not a wildcard it must be within the valid-directions
  (valid-transfer-types), "expansion" is unrelated to this.

11 years agotypo fixes in parse.scm
Andy Wingo [Fri, 8 Feb 2013 17:52:36 +0000 (18:52 +0100)]
typo fixes in parse.scm

* figl/parse.scm (string->directions, string->transfer-types): Fix what
  appear to be a couple of typos.  Please revert if this is not
  correct.

11 years agodebump version
Daniel Hartwig [Fri, 8 Feb 2013 11:32:39 +0000 (19:32 +0800)]
debump version

* configure.ac: Version back to 0.1; 2.0 only really applies to GL
  bindings, and we want to provide a broader subset anyway.

11 years agocreate stub of glut enums
Daniel Hartwig [Fri, 8 Feb 2013 11:29:29 +0000 (19:29 +0800)]
create stub of glut enums

* figl/glut/enums.spec: New file.

* examples/glut/demo.scm: Use glut enums.  Use clear-buffer-mask, not
  attrib-mask, now that it is correctly picked up as a bitfield.

* Makefile.am: Update.

11 years agouse type maps in update-enumerations
Daniel Hartwig [Fri, 8 Feb 2013 11:21:49 +0000 (19:21 +0800)]
use type maps in update-enumerations

* maint/update-enumerations (type-map, use-type-map): New procedures
  to set and use an appropriate type map.
  (bitfield?): Use type-map when possible.
  (write-scm, write-texi): Handle strip-bit failures gracefully.

* doc/low-level-gl-enums.texi:
* figl/gl/enums.scm: Regenerate, picking up more bitfields.

11 years agoadd type map parser
Daniel Hartwig [Fri, 8 Feb 2013 11:14:03 +0000 (19:14 +0800)]
add type map parser

* figl/parse.scm (parse-gl-type-map): New parser for type map files.

11 years agoadd module contrib with some helpers
Daniel Hartwig [Fri, 8 Feb 2013 11:10:59 +0000 (19:10 +0800)]
add module contrib with some helpers

* figl/contrib.scm: New file.
  (memoize): Wrapper to create memoized procedures.
  (string-split): Regexp-enhanced, until Guile core gets one.

* Makefile.am: Update.

11 years agoremove top low-level.scm from tree
Daniel Hartwig [Fri, 8 Feb 2013 01:51:30 +0000 (09:51 +0800)]
remove top low-level.scm from tree

* figl/low-level.scm: Remove this old file from tree.

11 years agogenerate glx enums
Andy Wingo [Thu, 7 Feb 2013 17:42:07 +0000 (18:42 +0100)]
generate glx enums

* Makefile.am (update-enums): Add update-enums target.  Add enums files
  to build and dist.

* maint/update-enumerations (main): Also generate glx enums.
* figl/parse.scm: Add more hacks to be able to parse glxenums.spec.

* doc/low-level-glx-enums.texi:
* figl/glx/enums.scm: New generated files.

11 years agoexamples use enums module
Andy Wingo [Thu, 7 Feb 2013 17:09:35 +0000 (18:09 +0100)]
examples use enums module

* examples/glut/demo.scm: Use the enums module.

11 years agodocs for enumerated values
Andy Wingo [Thu, 7 Feb 2013 17:05:10 +0000 (18:05 +0100)]
docs for enumerated values

* maint/update-enumerations: Generate documentation as well.

* doc/low-level-gl-enums.texi: New docs.
* doc/figl.texi: Include the new docs.

11 years agoadd enumerated values module
Andy Wingo [Thu, 7 Feb 2013 15:12:13 +0000 (16:12 +0100)]
add enumerated values module

* figl/parse.scm (parse-gl-enumerations): New routine to parse
  enumerations from a spec file.

* maint/update-enumerations: New tool.

* figl/runtime.scm (define-enumeration, define-bitfield): New runtime
  macros.

* figl/gl/enums.scm: New generated file.

* Makefile.am (SOURCES): Add gl/enums to build.

11 years agoupdate spec files from upstream
Andy Wingo [Thu, 7 Feb 2013 14:01:56 +0000 (15:01 +0100)]
update spec files from upstream

* upstream-doc/spec/: Update.

11 years agopatch enum.spec for syntactic validity
Andy Wingo [Thu, 7 Feb 2013 09:28:26 +0000 (10:28 +0100)]
patch enum.spec for syntactic validity

* upstream-doc/spec/enum.spec: Patch spec until
  http://www.khronos.org/bugzilla/show_bug.cgi?id=786 is fixed.

11 years agoadd spec files from upstream
Andy Wingo [Tue, 5 Feb 2013 21:16:02 +0000 (22:16 +0100)]
add spec files from upstream

* upstream-doc/update-spec: New script.
* upstream-doc/spec: Download spec files.

11 years agorename upstream-man-pages to upstream-doc
Andy Wingo [Tue, 5 Feb 2013 21:00:34 +0000 (22:00 +0100)]
rename upstream-man-pages to upstream-doc

* upstream-doc/: Rename from upstream-man-pages.

* figl/parse.scm:
* figl/config.scm.in: Adapt.

11 years agoinclude more low-level bindings
Andy Wingo [Tue, 5 Feb 2013 18:25:32 +0000 (19:25 +0100)]
include more low-level bindings

* figl/parse.scm (parse-prototypes): Relax the skip? function to include
  more bindings.

* figl/gl/low-level.scm:
* doc/low-level-gl.texi: Regenerate.

* figl/gl/types.scm (GLvoid-**): New definition.

11 years agoa #f array is the null pointer
Andy Wingo [Tue, 5 Feb 2013 17:43:19 +0000 (18:43 +0100)]
a #f array is the null pointer

* figl/gl/types.scm (array->pointer, define-array-foreign-type): Allow
  #f to indicate a null pointer.

11 years agoadd glut demo
Andy Wingo [Tue, 5 Feb 2013 12:15:01 +0000 (13:15 +0100)]
add glut demo

* examples/glut/demo.scm: Copied GLUT demo from Daniel Hartwig.

11 years agodocumentation work
Andy Wingo [Tue, 5 Feb 2013 11:53:10 +0000 (12:53 +0100)]
documentation work

* doc/figl.texi: Reorganize and flesh out.

11 years agoupdate loader comment
Andy Wingo [Tue, 5 Feb 2013 10:21:45 +0000 (11:21 +0100)]
update loader comment

* figl/gl/runtime.scm: Update comment about loaders.

11 years agofix the resolver mess, and add glut to the build
Andy Wingo [Tue, 5 Feb 2013 09:30:41 +0000 (10:30 +0100)]
fix the resolver mess, and add glut to the build

* maint/update-low-level-bindings (write-scm): Update to use
  module-specific runtimes, and to generate define-FOO-procedure forms.
  This way modules can control how their symbols are loaded.

* figl/runtime.scm: Remove the default resolver; instead have
  define-foreign-procedure take a resolver form.

* figl/gl/runtime.scm:
* figl/glu/runtime.scm:
* figl/glut/runtime.scm:
* figl/glx/runtime.scm: New support modules.

* figl/gl/low-level.scm:
* figl/glu/low-level.scm:
* figl/glx/low-level.scm: Regenerate.

* figl/glut/low-level.scm: Change to use define-glut-procedure, and to
  delegate all the resolver business to the runtime module.

* Makefile.am: Add new files, and add glut to the build.

11 years agoadd comment about how loaders should work
Andy Wingo [Mon, 4 Feb 2013 21:33:40 +0000 (22:33 +0100)]
add comment about how loaders should work

* figl/runtime.scm: Add a big comment about loaders and how they should
  work.

11 years agoinitial glut bindings
Daniel Hartwig [Mon, 4 Feb 2013 07:24:37 +0000 (15:24 +0800)]
initial glut bindings

* figl/glut/low-level.scm: Low-level bindings.

* figl/glut.scm: Initial high-level bindings; only one helper for
  glut-init.

11 years agodocumentation work
Andy Wingo [Sun, 3 Feb 2013 22:28:47 +0000 (23:28 +0100)]
documentation work

* doc/figl.texi: Add some docs.

11 years agobeginnings of high-level modules
Andy Wingo [Sun, 3 Feb 2013 18:39:30 +0000 (19:39 +0100)]
beginnings of high-level modules

* Makefile.am: Add the new modules.
* figl/gl.scm:
* figl/glx.scm: Add high-level modules.  Nothing in them yet except a
  resolver.

11 years agobetter handling of array arguments, strings
Andy Wingo [Sat, 2 Feb 2013 21:11:33 +0000 (22:11 +0100)]
better handling of array arguments, strings

* figl/gl/types.scm: Array arguments are passed as bytevectors.  Strings
  use pointer<->string.

11 years agotype-specific wrapping and unwrapping of scheme values
Andy Wingo [Sat, 2 Feb 2013 20:38:31 +0000 (21:38 +0100)]
type-specific wrapping and unwrapping of scheme values

* figl/runtime.scm (foreign-trampoline):
  (define-foreign-procedure):
  (define-foreign-type):
  (define-simple-foreign-type): Provide for a way for types to wrap and
  unwrap foreign values.

* figl/glx/types.scm:
* figl/glu/types.scm:
* figl/gl/types.scm: Adapt to define types with the runtime's macros.

11 years agodefine-foreign-procedure makes one def.; add define-foreign-procedures
Andy Wingo [Sat, 2 Feb 2013 19:54:25 +0000 (20:54 +0100)]
define-foreign-procedure makes one def.; add define-foreign-procedures

* figl/runtime.scm (define-foreign-procedure):
  (define-foreign-procedures): Split define-foreign-procedure into two
  parts: one that handles the variants, and one "core" macro.

* maint/update-low-level-bindings: Update to generate
  define-foreign-procedures invocations.

* figl/gl/low-level.scm:
* figl/glu/low-level.scm:
* figl/glx/low-level.scm: Regenerate.

11 years agosimplify gl type name creation
Andy Wingo [Fri, 1 Feb 2013 21:23:16 +0000 (22:23 +0100)]
simplify gl type name creation

* figl/parse.scm (string->gl-type): Simplify.

* figl/glx/types.scm (const-GLXContext): Missing decl.

* figl/glx/low-level.scm: Regenerate.

11 years agodefine more types
Andy Wingo [Fri, 1 Feb 2013 21:18:18 +0000 (22:18 +0100)]
define more types

* figl/parse.scm: Don't reduce pointer types to "*" early on.  Instead,
  try to preserve the information that we have.

* doc/low-level-gl.texi:
* doc/low-level-glu.texi:
* doc/low-level-glx.texi:
* figl/glx/low-level.scm:
* figl/glu/low-level.scm:
* figl/gl/low-level.scm:  Regenerate.

* figl/gl/types.scm:
* figl/glu/types.scm:
* figl/glx/types.scm: Define more types.

11 years agoskip double variants, not float variants
Andy Wingo [Fri, 1 Feb 2013 20:27:13 +0000 (21:27 +0100)]
skip double variants, not float variants

* figl/parse.scm (parse-prototypes): Skip double variants instead of
  skipping float variants, to better match hardware capabilities.

* figl/gl/low-level.scm:
* doc/low-level-gl.texi: Regenerate.

11 years agoreorganize file structures; allow for module-specific types
Andy Wingo [Fri, 1 Feb 2013 20:20:17 +0000 (21:20 +0100)]
reorganize file structures; allow for module-specific types

* figl/runtime.scm: Rename from (figl low-level support).

* doc/low-level-glx.texi:
* doc/low-level-glu.texi:
* doc/low-level-gl.texi: Regenerated.

* figl/gl/low-level.scm:
* figl/glu/low-level.scm:
* figl/glx/low-level.scm: Moved here, from figl/low-level/foo.scm.

* maint/update-low-level-bindings: Update script for new locations, and
  to use type modules.

* figl/glx/types.scm:
* figl/glu/types.scm:
* figl/gl/types.scm: New module-specific types.

* figl/low-level/types.scm: Removed in favor of module-specific types.

* Makefile.am: Update.

11 years agodefinitions for common types
Andy Wingo [Fri, 1 Feb 2013 16:10:51 +0000 (17:10 +0100)]
definitions for common types

* figl/low-level/support.scm: Re-export the types module, and define
  void.

11 years agoadd figl/low-level/types.scm
Daniel Hartwig [Fri, 1 Feb 2013 05:32:05 +0000 (13:32 +0800)]
add figl/low-level/types.scm

* figl/low-level/types.scm: New file.  Mappings from OpenGL to FFI types.

* Makefile.am: Add.

11 years agocurrent-gl-resolver parameter
Andy Wingo [Fri, 1 Feb 2013 16:04:50 +0000 (17:04 +0100)]
current-gl-resolver parameter

* figl/low-level/support.scm (default-foreign-resolver):
  (current-gl-resolver, resolve-foreign): Export current-gl-resolver
  as a parameter.

11 years agostart to actually making foreign wrappers
Andy Wingo [Fri, 1 Feb 2013 15:58:04 +0000 (16:58 +0100)]
start to actually making foreign wrappers

* figl/low-level/support.scm (resolve-foreign): New helper.
  (foreign-trampoline): New helper.
  (define-gl-procedure): Begin to consider actually doing the right
  thing!

11 years agohandle families of functions with different signatures
Andy Wingo [Fri, 1 Feb 2013 15:20:48 +0000 (16:20 +0100)]
handle families of functions with different signatures

* figl/parse.scm (gl-definition): Change prototype field to prototypes.
  (xml-funcprototypes): New func, replaces xml-prototype.
  (string->gl-type): Trim spaces.  Always make a symbol (what was going
  on here before with the double quote?)
  (parse-prototypes): Extract all prototypes.  Attempt to elide
  redundant procedures.
  (parse-gl-definitions, xml->definition): Don't generate definitions
  for man pages without prototypes.

* maint/update-low-level-bindings (write-scm): Adapt format of
  define-gl-procedure, and generate a correct export list.

* doc/low-level-gl.texi:
* doc/low-level-glu.texi:
* doc/low-level-glx.texi:
* figl/low-level/gl.scm:
* figl/low-level/glu.scm:
* figl/low-level/glx.scm: Update generated files.

* figl/low-level/support.scm (define-gl-procedure): Adapt to make
  multiple definitions.

11 years agofirst attempt at parse-prototype
Daniel Hartwig [Fri, 1 Feb 2013 11:21:46 +0000 (19:21 +0800)]
first attempt at parse-prototype

* figl/parse.scm: First attempt at parse-prototype.  Outputs a form
  similar to the one used by the glut bindings.  Keeping the
  function name around as it is needed: refname is not particularly
  useful.

11 years agobump version
Andy Wingo [Fri, 1 Feb 2013 11:40:59 +0000 (12:40 +0100)]
bump version

* .gitignore: Update.
* configure.ac: Version of 2.0, as we will wrap OpenGL version 2.x.

11 years agofix distcheck, make valid texinfo that can make pdfs
Andy Wingo [Fri, 1 Feb 2013 11:39:43 +0000 (12:39 +0100)]
fix distcheck, make valid texinfo that can make pdfs

* Makefile.am (EXTRA_DIST): Add other .texi files to dist.

* doc/low-level-gl.texi:
* doc/low-level-glu.texi:
* doc/low-level-glx.texi:
* figl/low-level/gl.scm:
* figl/low-level/glu.scm:
* figl/low-level/glx.scm: Regenerate.

* figl/parse.scm (*rules*): Avoid <title> elements; headings can't be
  present in @defun sections.  Don't generate @math blocks, as texi2pdf
  does not interpret them well.  Instead use @r.

* maint/update-low-level-bindings (unique-copyrights): Handle lack of
  copyright (shouldn't happen).
  (write-scm): Make plain-text docstrings again.

11 years agogenerate separate modules for gl, glu, glx; add info target
Andy Wingo [Fri, 1 Feb 2013 11:10:06 +0000 (12:10 +0100)]
generate separate modules for gl, glu, glx; add info target

* .gitignore: New file.

* Makefile.am: Add documentation, and only update the generated files
  when asked to.  Add new low-level generated files and generated
  documentation.

* doc/figl.texi: New file.

* doc/low-level-gl.texi:
* doc/low-level-glu.texi:
* doc/low-level-glx.texi: New generated files.

* figl/config.scm.in: Add abs-top-srcdir.

* figl/low-level.inc.scm: Removed.

* figl/low-level/gl.scm:
* figl/low-level/glu.scm:
* figl/low-level/glx.scm: New generated files.

* figl/low-level/support.scm: New runtime support file.

* figl/parse.scm: Update to expose a "gl-definition" data type, and
  expose a parse-to-list interface rather than a fold interface.
  Various hacky documentation tweaks to generate valid stexi for the
  whole binding set.

* generate-low-level-bindings:
* maint/update-low-level-bindings: Move the updater into maint/ dir, and
  only run when asked.  Generate whole modules, and documentation too.

11 years agoplain-text docstrings
Andy Wingo [Thu, 31 Jan 2013 22:01:50 +0000 (23:01 +0100)]
plain-text docstrings

* figl/parse.scm (generate-documentation): Generate plain text for now.

* figl/low-level.inc.scm: Check in this file.

11 years agogenerate low-level bindings
Andy Wingo [Thu, 31 Jan 2013 21:54:47 +0000 (22:54 +0100)]
generate low-level bindings

* Makefile.am: Add rules to generate low-level.inc.scm.
* generate-low-level-bindings: New helper.

* figl/parse.scm: Rework to deal with versions instead of man sections.
  Define and export fold-gl-definitions.

* figl/low-level.scm: New file, for the low-level bindings.

11 years agodocstrings for one and all
Andy Wingo [Thu, 31 Jan 2013 21:17:49 +0000 (22:17 +0100)]
docstrings for one and all

* figl/parse.scm (generate-documentation): Produce a serialized texinfo
  fragment.
  (*rules*): Add enough terrible hacky rules that we can parse all of
  the docbook in man2 without warnings.
  (*man-sections*): Turns out these aren't manual sections; they are
  versions of the API.  Just focus on OpenGL 2.x for now.

11 years agomore work on parser
Andy Wingo [Thu, 31 Jan 2013 08:22:51 +0000 (09:22 +0100)]
more work on parser

* figl/parse.scm: Update to use newest xml->sxml features, and the
  beginnings of parsing the XML files.

11 years agoadd figl/parse.scm
Andy Wingo [Mon, 28 Jan 2013 21:50:53 +0000 (22:50 +0100)]
add figl/parse.scm

* figl/parse.scm: New file.

* Makefile.am: Add.

11 years agoadd figl/config.scm
Andy Wingo [Mon, 28 Jan 2013 21:50:09 +0000 (22:50 +0100)]
add figl/config.scm

* figl/config.scm.in: New file.

* configure.ac: Generate config.scm.

* Makefile.am:
* .gitignore: Add config.scm.

11 years agoadd upstream documentation
Andy Wingo [Fri, 25 Jan 2013 16:41:54 +0000 (17:41 +0100)]
add upstream documentation

* upstream-man-pages/update: New script, downloads documentation from
  khronos.org.

* upstream-man-pages/man2:
* upstream-man-pages/man3:
* upstream-man-pages/man4:
* upstream-man-pages/manglsl: Update.

11 years agoinitial import
Andy Wingo [Fri, 25 Jan 2013 16:03:55 +0000 (17:03 +0100)]
initial import

11 years agoinitial empty commit
Andy Wingo [Fri, 25 Jan 2013 15:28:28 +0000 (16:28 +0100)]
initial empty commit