clinton/guile-figl.git
10 years agoRevert "update upstream sources" master
Daniel Hartwig [Tue, 23 Jul 2013 07:40:41 +0000 (15:40 +0800)]
Revert "update upstream sources"

This reverts commit c7b3127165b9995561d5c7d7d6ca1184f089c797.

10 years agoRevert "update for begin-mode -> primitive-type"
Daniel Hartwig [Tue, 23 Jul 2013 07:40:32 +0000 (15:40 +0800)]
Revert "update for begin-mode -> primitive-type"

This reverts commit 54ead4dd26dd07c0d90d6643edb822fa322b4a46.

10 years agofix typo
Daniel Hartwig [Mon, 22 Jul 2013 07:17:23 +0000 (15:17 +0800)]
fix typo

10 years agogl: minimal interface to texture objects
Daniel Hartwig [Fri, 19 Jul 2013 16:41:34 +0000 (00:41 +0800)]
gl: minimal interface to texture objects

* figl/gl.scm (gl-generate-texture, gl-delete-texture):
  (gl-bind-texture): Minimal interface to aid using textures.

10 years agoupdate for begin-mode -> primitive-type
Daniel Hartwig [Thu, 18 Jul 2013 10:26:48 +0000 (18:26 +0800)]
update for begin-mode -> primitive-type

10 years agoupdate upstream sources
Daniel Hartwig [Thu, 18 Jul 2013 10:11:16 +0000 (18:11 +0800)]
update upstream sources

10 years agotypo in gl.texi
Daniel Hartwig [Thu, 18 Jul 2013 09:52:12 +0000 (17:52 +0800)]
typo in gl.texi

10 years agowith- helpers return values from their body
Daniel Hartwig [Thu, 18 Jul 2013 09:44:01 +0000 (17:44 +0800)]
with- helpers return values from their body

* figl/gl.scm (with-gl-push-matrix, with-gl-push-attrib): Return the
  value(s) of the last expression in BODY.

10 years agocheck usage of the term 'OpenGL'
Daniel Hartwig [Thu, 18 Jul 2013 07:36:50 +0000 (15:36 +0800)]
check usage of the term 'OpenGL'

Ensure that early uses of the term in each chapter are distinguished,
and that there is no implication that Figl is or implements 'OpenGL'
-- we are only a language binding to the interface.

<http://www.gnu.org/prep/standards/html_node/Trademarks.html>
<http://www.sgi.com/products/software/opengl/trademarks.pdf>

10 years agotypos and minor changes to docs
Daniel Hartwig [Thu, 18 Jul 2013 06:39:19 +0000 (14:39 +0800)]
typos and minor changes to docs

10 years agoadd remaining non-trivial copyright notices
Daniel Hartwig [Sun, 5 May 2013 07:45:26 +0000 (15:45 +0800)]
add remaining non-trivial copyright notices

11 years agoremove primitive glut demo
Daniel Hartwig [Sat, 13 Apr 2013 02:50:00 +0000 (10:50 +0800)]
remove primitive glut demo

* examples/glut/demo.scm: Removed.  The null-program demo uses
  GLUT and is nicer.

11 years agoadd copyright notices to docs
Daniel Hartwig [Sat, 13 Apr 2013 02:49:35 +0000 (10:49 +0800)]
add copyright notices to docs

11 years agoadd copyright notices to non-trivial files
Daniel Hartwig [Sat, 13 Apr 2013 02:12:54 +0000 (10:12 +0800)]
add copyright notices to non-trivial files

11 years agoadd particle system example using vertex buffer objects wip-particles
Andy Wingo [Fri, 15 Feb 2013 22:21:11 +0000 (23:21 +0100)]
add particle system example using vertex buffer objects

* examples/particle-system/vbo.scm: New example, using vertex buffer
  objects.

11 years agoMerge branch 'master' into wip-particles
Andy Wingo [Fri, 15 Feb 2013 22:20:31 +0000 (23:20 +0100)]
Merge branch 'master' into wip-particles

11 years agobind buffer objects
Andy Wingo [Fri, 15 Feb 2013 22:19:56 +0000 (23:19 +0100)]
bind buffer objects

* figl/gl.scm (->pointer): Accept #f as a null pointer.
  (gl-generate-buffer):
  (gl-delete-buffer):
  (set-gl-buffer-data):
  (update-gl-buffer-data):
  (gl-bind-buffer): New bindings.

11 years agoclient array example uses vertex array instead of quad array
Andy Wingo [Fri, 15 Feb 2013 21:05:57 +0000 (22:05 +0100)]
client array example uses vertex array instead of quad array

* figl/contrib/packed-struct.scm (packed-struct-offset): New export.

* examples/particle-system/client-arrays.scm: Rewrite using a vertex
  array instead of a quad array.  It's the same thing, only a bit
  cleaner.

11 years agoMerge branch 'master' into wip-particles
Andy Wingo [Fri, 15 Feb 2013 20:25:30 +0000 (21:25 +0100)]
Merge branch 'master' into wip-particles

11 years agoadd support for client-state vertex arrays
Andy Wingo [Fri, 15 Feb 2013 20:19:53 +0000 (21:19 +0100)]
add support for client-state vertex arrays

* figl/gl.scm: Add client-state vertex arrays, based on a patch by
  Daniel Hartwig.

11 years agoadd particle-system variant using client-state arrays
Andy Wingo [Fri, 15 Feb 2013 20:18:19 +0000 (21:18 +0100)]
add particle-system variant using client-state arrays

* examples/particle-system/legacy.scm: Move here, from
  examples/particle-system.scm.

* examples/particle-system/client-arrays.scm: New version of the
  particle system that uses client arrays.

11 years agoexport packed-struct-size
Andy Wingo [Fri, 15 Feb 2013 20:18:56 +0000 (21:18 +0100)]
export packed-struct-size

* figl/contrib/packed-struct.scm (packed-struct-size): Export.

11 years agoadd support for client-state vertex arrays
Andy Wingo [Fri, 15 Feb 2013 20:19:53 +0000 (21:19 +0100)]
add support for client-state vertex arrays

* figl/gl.scm: Add client-state vertex arrays, based on a patch by
  Daniel Hartwig.

11 years agoreimplement particle-system using packed structs
Andy Wingo [Fri, 15 Feb 2013 14:57:08 +0000 (15:57 +0100)]
reimplement particle-system using packed structs

* examples/particle-system.scm: Reimplement in terms of packed structs.

11 years agoadd (figl contrib packed-struct)
Andy Wingo [Fri, 15 Feb 2013 14:56:33 +0000 (15:56 +0100)]
add (figl contrib packed-struct)

* Makefile.am:
* figl/contrib/packed-struct.scm: New file.

11 years agomove around "general" in section title for neater formatting
Daniel Hartwig [Fri, 15 Feb 2013 07:07:55 +0000 (15:07 +0800)]
move around "general" in section title for neater formatting

* doc/figl.texi (API Conventions): Renamed from "General API
  Conventions" to have better formatted menu.

11 years agofix typo in previous commit
Daniel Hartwig [Fri, 15 Feb 2013 07:04:30 +0000 (15:04 +0800)]
fix typo in previous commit

* doc/figl.texi (General API Conventions): Bindings and text are *not*
  synced.

11 years agodraft naming conventions
Daniel Hartwig [Fri, 15 Feb 2013 07:01:08 +0000 (15:01 +0800)]
draft naming conventions

* doc/figl.scm (General API Conventions): New section documenting
  naming, etc. conventions used generally.  Very much a work in
  progress and no solid idea on the final product.

* TODO: Touch.

11 years agogl: rename texture-coordinate to texture-coordinates
Daniel Hartwig [Fri, 15 Feb 2013 05:28:16 +0000 (13:28 +0800)]
gl: rename texture-coordinate to texture-coordinates

* figl/gl.scm (gl-texture-coordinates, gl-multi-texture-coordinates):
  Renamed from non-plural names.  Not `fog-coordinate', as that is
  only a single coordinate.

* doc/gl.texi (Vertex Specification): Update.

11 years agoupdate TODO
Daniel Hartwig [Fri, 15 Feb 2013 05:14:55 +0000 (13:14 +0800)]
update TODO

* TODO: Add notes on .spec parsing, enumeration usage.

11 years agoadd packed structures to TODO
Daniel Hartwig [Thu, 14 Feb 2013 01:11:23 +0000 (09:11 +0800)]
add packed structures to TODO

* TODO (Packed structures.): New note, with pointers to some existing work.

11 years agoadd simple particle system example
Andy Wingo [Wed, 13 Feb 2013 15:07:43 +0000 (16:07 +0100)]
add simple particle system example

* examples/particle-system.scm: Add a simple particle system.

11 years ago#f is a null pointer for glut callbacks
Andy Wingo [Wed, 13 Feb 2013 15:06:09 +0000 (16:06 +0100)]
#f is a null pointer for glut callbacks

* figl/glut/types.scm (coerce-callback-pointer/ephemeral):
  (coerce-callback-pointer/sticky): Allow #f to indicate a null pointer.

11 years agoexpand TODO
Daniel Hartwig [Wed, 13 Feb 2013 00:59:33 +0000 (08:59 +0800)]
expand TODO

* TODO: Add some more notes, expand on others.

11 years agoadd TODO
Andy Wingo [Tue, 12 Feb 2013 12:58:20 +0000 (13:58 +0100)]
add TODO

* TODO: New file.

11 years agobeginnings of glut documentation
Andy Wingo [Tue, 12 Feb 2013 12:56:51 +0000 (13:56 +0100)]
beginnings of glut documentation

* Makefile.am:
* doc/figl.texi:
* doc/glut.texi:
* doc/glx.texi: Factor GLX and GLUT documentation out into separate
  files.  Start documenting GLUT.

11 years agofix export typo for glut
Andy Wingo [Tue, 12 Feb 2013 12:55:22 +0000 (13:55 +0100)]
fix export typo for glut

* figl/glut.scm (window-rgba?): Fix export typo.

11 years agohigh-level glu documentation
Andy Wingo [Tue, 12 Feb 2013 11:35:17 +0000 (12:35 +0100)]
high-level glu documentation

* Makefile.am:
* doc/figl.texi:
* doc/glu.texi: Factor GLU docs into separate file, and add high-level
  documentation.

11 years agoadd high-level GL docs
Andy Wingo [Tue, 12 Feb 2013 11:05:24 +0000 (12:05 +0100)]
add high-level GL docs

* Makefile.am:
* doc/figl.texi:
* doc/gl.texi: Factor GL docs into a separate file.  Add documentation
  for the high-level interface.

11 years agoremove gl-push-matrix and gl-pop-matrix
Andy Wingo [Tue, 12 Feb 2013 11:04:52 +0000 (12:04 +0100)]
remove gl-push-matrix and gl-pop-matrix

* figl/gl.scm: Remove gl-push-matrix and gl-pop-matrix, as there is
  with-gl-push-matrix.

11 years agomore high-level gl bindings
Andy Wingo [Tue, 12 Feb 2013 08:45:58 +0000 (09:45 +0100)]
more high-level gl bindings

* figl/gl.scm (set-gl-matrix-mode): Rename from gl-matrix-mode.
  (set-gl-shade-model): New export.
  (with-gl-push-attrib): New export.

11 years agoadd (figl glu)
Andy Wingo [Tue, 12 Feb 2013 08:45:00 +0000 (09:45 +0100)]
add (figl glu)

* figl/glu.scm: New file.
* Makefile.am: Add to build.

11 years agoglut: rename sub-window?
Daniel Hartwig [Tue, 12 Feb 2013 09:09:59 +0000 (17:09 +0800)]
glut: rename sub-window?

* figl/glut.scm (subwindow?): Renamed from sub-window?, as per recent
  commits.

11 years agoglut: clean up window state getters
Daniel Hartwig [Tue, 12 Feb 2013 08:52:04 +0000 (16:52 +0800)]
glut: clean up window state getters

* figl/glut.scm (define-glut-state, define-glut-states):
  (define-glut-window-state, define-glut-window-states): New helpers
  to define integer glut state.

  (window-color-buffer-red-size, etc.): Renamed from window-red-size.

  (window-accumulation-buffer-red-size): Add getters for accumulation
  buffer color state.

11 years agoglut: actually manage subwindows
Daniel Hartwig [Tue, 12 Feb 2013 08:23:34 +0000 (16:23 +0800)]
glut: actually manage subwindows

* figl/glut.scm (%make-window): No longer memoized in favour of
  manually keeping a table of created windows.  Dropped live?
  argument.  When managing subwindows, the high-level interface no
  longer support windows created with the low-level bindings.

  (lookup-window): New procedure.  Clears up some logic when expecting
  to find an existing window.
  (current-window, window-parent): Use lookup-window.

  (make-subwindow): Renamed from make-sub-window to use the exact term
  formally defined and more commonly used in the specification.

  (window): New field subwindows.
  (destroy-window): Recursively mark subwindows.

11 years agopass pairs to set-initial-window-{position,size}
Daniel Hartwig [Tue, 12 Feb 2013 07:22:16 +0000 (15:22 +0800)]
pass pairs to set-initial-window-{position,size}

* figl/glut.scm (set-initial-window-position):
  (set-initial-window-size): Change arguments to a pair, matching the
  output of the corresponding getters and initialize-glut keyword
  arguments.

11 years agoadd null-program example
Andy Wingo [Mon, 11 Feb 2013 17:10:22 +0000 (18:10 +0100)]
add null-program example

* Makefile.am: Dist examples and upstream-doc.

* examples/null-program.scm: New example.

11 years agofix callback pointer wrapping in glut
Andy Wingo [Mon, 11 Feb 2013 16:45:04 +0000 (17:45 +0100)]
fix callback pointer wrapping in glut

* figl/glut/types.scm (coerce-callback-pointer/ephemeral):
  (coerce-callback-pointer/sticky): Fix to protect the pointer in
  addition to the procedure.

11 years agoautomatic glut initialization
Andy Wingo [Mon, 11 Feb 2013 15:00:45 +0000 (16:00 +0100)]
automatic glut initialization

* figl/glut/runtime.scm (resolve): Run a hook before resolving glut
  symbols.  Remove the plural define-glut-procedures.

* figl/glut.scm: Rename glut-init to initialize-glut, and add keyword
  arguments for initial window size, position, and display mode.
  Default to (program-arguments) for args.  Make the glut-init? marker
  global, not thread-local.  Add resolve hook to initialize-glut as
  needed.

* examples/glut/demo.scm: Update.

11 years agoadd high-level interfaces to glut callback registration funcs
Andy Wingo [Mon, 11 Feb 2013 11:25:17 +0000 (12:25 +0100)]
add high-level interfaces to glut callback registration funcs

* figl/glut/types.scm (define-ephemeral-callback-pointer-type)
  (define-sticky-callback-pointer-type): Provide a way to protect
  procedures passed into GLUT from being GC'd.  Change the definitions
  of the pointer types to use these new helpers.

* figl/glut/low-level.scm: Use the pointer types defined in (figl glut
  types).

* figl/glut.scm: Add exports for the callback registration functions.

* examples/glut/demo.scm: Use set-display-callback.  Now the demo uses
  no low-level GLUT interfaces.

11 years agoupdate gitignore
Andy Wingo [Mon, 11 Feb 2013 08:53:43 +0000 (09:53 +0100)]
update gitignore

* .gitignore: Ignore any number of info fragments.

11 years agouse ptrdiff_t if available, otherwise keep compat with released Guile
Andy Wingo [Mon, 11 Feb 2013 08:47:04 +0000 (09:47 +0100)]
use ptrdiff_t if available, otherwise keep compat with released Guile

* figl/gl/types.scm (%ptr): Back-compatible definitions for Guile <
  2.0.8.

11 years agomap GLboolean to Scheme boolean
Daniel Hartwig [Mon, 11 Feb 2013 06:35:32 +0000 (14:35 +0800)]
map GLboolean to Scheme boolean

* figl/gl/types.scm (GLboolean): Convert to and from appropriate
  Scheme values.

11 years agoadd glut callback-pointer types
Daniel Hartwig [Mon, 11 Feb 2013 06:14:16 +0000 (14:14 +0800)]
add glut callback-pointer types

* figl/glut/types.scm: New file.  Contains types previously defined in
  low-level.  Add callback-pointer types, but not used yet.

* figl/glut/low-level.scm: Move previous type definitions to new types
  module.

* Makefile.am: Update for new file.

11 years agoadd high-level glut bindings for init., windows
Daniel Hartwig [Mon, 11 Feb 2013 04:22:52 +0000 (12:22 +0800)]
add high-level glut bindings for init., windows

* figl/glut.scm: Add high-level bindings for more initialization
  procedures.  Bindings and data type for managing windows.  Some
  procedures to set and retrieve state relating to these.

* examples/glut/demo.scm: Update to use high-level bindings.

11 years agoadd high-level gl bindings for fragment and framebuffer operations
Daniel Hartwig [Mon, 11 Feb 2013 04:19:04 +0000 (12:19 +0800)]
add high-level gl bindings for fragment and framebuffer operations

* figl/gl.scm (gl-clear, set-gl-clear-color, etc.): High-level
  bindings for functions pertaining to fragment and framebuffer
  operations.  There is now enough high-level to run the fixed
  function pipeline.

* examples/glut/demo.scm: Use high-level gl bindings.

11 years agoremove low-level gl-begin/end from high-level bindings
Daniel Hartwig [Mon, 11 Feb 2013 03:30:35 +0000 (11:30 +0800)]
remove low-level gl-begin/end from high-level bindings

* figl/gl.scm (gl-begin): Replace low-level re-export with syntax form
  like 'begin'.  Return final value from body expressions.  Require at
  least one body expression.

11 years agorename modifier-key-state to modifiers
Daniel Hartwig [Mon, 11 Feb 2013 02:52:26 +0000 (10:52 +0800)]
rename modifier-key-state to modifiers

* figl/glut/enums.scm (modifiers): Renamed from modifier-key-state.

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.