From 7ec693ed6a76a00b97f132d7a1c5667933325d62 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Fri, 1 Feb 2013 21:20:17 +0100 Subject: [PATCH] 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. --- Makefile.am | 12 +- doc/low-level-gl.texi | 2 +- doc/low-level-glu.texi | 2 +- doc/low-level-glx.texi | 2 +- figl/{low-level/gl.scm => gl/low-level.scm} | 432 +++++++++--------- figl/{low-level => gl}/types.scm | 3 +- figl/{low-level/glu.scm => glu/low-level.scm} | 114 ++--- figl/glu/types.scm | 27 ++ figl/{low-level/glx.scm => glx/low-level.scm} | 92 ++-- figl/glx/types.scm | 27 ++ figl/{low-level/support.scm => runtime.scm} | 26 +- maint/update-low-level-bindings | 27 +- 12 files changed, 412 insertions(+), 354 deletions(-) rename figl/{low-level/gl.scm => gl/low-level.scm} (99%) rename figl/{low-level => gl}/types.scm (97%) rename figl/{low-level/glu.scm => glu/low-level.scm} (98%) create mode 100644 figl/glu/types.scm rename figl/{low-level/glx.scm => glx/low-level.scm} (98%) create mode 100644 figl/glx/types.scm rename figl/{low-level/support.scm => runtime.scm} (78%) diff --git a/Makefile.am b/Makefile.am index b07f119..255d508 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,11 +7,13 @@ SOURCES = \ figl.scm \ figl/config.scm \ figl/parse.scm \ - figl/low-level/types.scm \ - figl/low-level/support.scm \ - figl/low-level/gl.scm \ - figl/low-level/glu.scm \ - figl/low-level/glx.scm + figl/runtime.scm \ + figl/gl/types.scm \ + figl/gl/low-level.scm \ + figl/glu/types.scm \ + figl/glu/low-level.scm \ + figl/glx/types.scm \ + figl/glx/low-level.scm update: figl/parse.go $(top_builddir)/env $(GUILE) $(top_srcdir)/maint/update-low-level-bindings diff --git a/doc/low-level-gl.texi b/doc/low-level-gl.texi index 2e132fd..0f15785 100644 --- a/doc/low-level-gl.texi +++ b/doc/low-level-gl.texi @@ -4,7 +4,7 @@ The functions from this section may be had by loading the module: @example -(use-modules (figl low-level gl)) +(use-modules (figl gl low-level) @end example @copying diff --git a/doc/low-level-glu.texi b/doc/low-level-glu.texi index 2e810a9..7f7baa0 100644 --- a/doc/low-level-glu.texi +++ b/doc/low-level-glu.texi @@ -4,7 +4,7 @@ The functions from this section may be had by loading the module: @example -(use-modules (figl low-level glu)) +(use-modules (figl glu low-level) @end example @copying diff --git a/doc/low-level-glx.texi b/doc/low-level-glx.texi index 6605af1..0b6540e 100644 --- a/doc/low-level-glx.texi +++ b/doc/low-level-glx.texi @@ -4,7 +4,7 @@ The functions from this section may be had by loading the module: @example -(use-modules (figl low-level glx)) +(use-modules (figl glx low-level) @end example @copying diff --git a/figl/low-level/gl.scm b/figl/gl/low-level.scm similarity index 99% rename from figl/low-level/gl.scm rename to figl/gl/low-level.scm index cc170c5..8a9a17d 100644 --- a/figl/low-level/gl.scm +++ b/figl/gl/low-level.scm @@ -41,9 +41,11 @@ ;;; (define-module - (figl low-level gl) + (figl gl low-level) #:use-module - (figl low-level support) + (figl runtime) + #:use-module + (figl gl types) #:export (glAccum glActiveTexture @@ -338,7 +340,7 @@ glWindowPos3i glWindowPos3d)) -(define-gl-procedure +(define-foreign-procedure ((glAccum (op GLenum) (value GLfloat) -> void)) "Operate on the accumulation buffer. @@ -426,7 +428,7 @@ enabled. `GL_INVALID_OPERATION' is generated if `glAccum' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glActiveTexture (texture GLenum) -> void)) "Select active texture unit. @@ -449,7 +451,7 @@ Vertex arrays are client-side GL resources, which are selected by the where i ranges from 0 to the larger of (`GL_MAX_TEXTURE_COORDS' - 1) and (`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS' - 1).") -(define-gl-procedure +(define-foreign-procedure ((glAlphaFunc (func GLenum) (ref GLclampf) @@ -522,7 +524,7 @@ affect screen clear operations. `GL_INVALID_OPERATION' is generated if `glAlphaFunc' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glAreTexturesResident (n GLsizei) (textures *) @@ -572,7 +574,7 @@ the contents of RESIDENCES is indeterminate. executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glArrayElement (i GLint) -> void)) "Render a vertex using the specified vertex array element. @@ -606,7 +608,7 @@ to array data may access original data. bound to an enabled array and the buffer object's data store is currently mapped.") -(define-gl-procedure +(define-foreign-procedure ((glAttachShader (program GLuint) (shader GLuint) @@ -655,7 +657,7 @@ PROGRAM. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glBeginQuery (target GLenum) (id GLuint) @@ -705,7 +707,7 @@ active query object. executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glBegin (mode GLenum) -> void) (glEnd -> void)) "Delimit the vertices of a primitive or a group of like primitives. @@ -821,7 +823,7 @@ Execution of `glEnableClientState', `glDisableClientState', `glBegin' and before the corresponding call to `glEnd', but an error may or may not be generated.") -(define-gl-procedure +(define-foreign-procedure ((glBindAttribLocation (program GLuint) (index GLuint) @@ -895,7 +897,7 @@ OpenGL. executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glBindBuffer (target GLenum) (buffer GLuint) @@ -998,7 +1000,7 @@ values. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glBindTexture (target GLenum) (texture GLuint) @@ -1072,7 +1074,7 @@ with a target that doesn't match that of TARGET. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glBitmap (width GLsizei) (height GLsizei) @@ -1167,7 +1169,7 @@ would exceed the data store size. `GL_INVALID_OPERATION' is generated if `glBitmap' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glBlendColor (red GLclampf) (green GLclampf) @@ -1196,7 +1198,7 @@ blending operations. Initially the `GL_BLEND_COLOR' is set to (0, 0, 0, between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glBlendEquationSeparate (modeRGB GLenum) (modeAlpha GLenum) @@ -1276,7 +1278,7 @@ of `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT', executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glBlendEquation (mode GLenum) -> void)) "Specify the equation used for both the RGB blend equation and the Alpha blend equation. @@ -1344,7 +1346,7 @@ set to `GL_FUNC_ADD'. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glBlendFuncSeparate (srcRGB GLenum) (dstRGB GLenum) @@ -1492,7 +1494,7 @@ accepted value. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glBlendFunc (sfactor GLenum) (dfactor GLenum) @@ -1626,7 +1628,7 @@ accepted value. `GL_INVALID_OPERATION' is generated if `glBlendFunc' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glBufferData (target GLenum) (size GLsizeiptr) @@ -1717,7 +1719,7 @@ store with the specified SIZE. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glBufferSubData (target GLenum) (offset GLintptr) @@ -1768,7 +1770,7 @@ is mapped. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glCallLists (n GLsizei) (type GLenum) @@ -1873,7 +1875,7 @@ remain after execution is completed. Use `glPushAttrib', `glPopAttrib', `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', `GL_2_BYTES', `GL_3_BYTES', `GL_4_BYTES'.") -(define-gl-procedure +(define-foreign-procedure ((glCallList (list GLuint) -> void)) "Execute a display list. @@ -1897,7 +1899,7 @@ after execution of the display list is completed. Use `glPushAttrib', `glPopAttrib', `glPushMatrix', and `glPopMatrix' to preserve GL state across `glCallList' calls.") -(define-gl-procedure +(define-foreign-procedure ((glClearAccum (red GLfloat) (green GLfloat) @@ -1926,7 +1928,7 @@ Values specified by `glClearAccum' are clamped to the range [-1,1] . between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glClearColor (red GLclampf) (green GLclampf) @@ -1954,7 +1956,7 @@ are clamped to the range [0,1] . between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glClearDepth (depth GLclampd) -> void)) "Specify the clear value for the depth buffer. @@ -1970,7 +1972,7 @@ range [0,1] . between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glClearIndex (c GLfloat) -> void)) "Specify the clear value for the color index buffers. @@ -1988,7 +1990,7 @@ number of bits in a color index stored in the frame buffer. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glClearStencil (s GLint) -> void)) "Specify the clear value for the stencil buffer. @@ -2004,7 +2006,7 @@ in the stencil buffer. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glClear (mask GLbitfield) -> void)) "Clear buffers to preset values. @@ -2051,7 +2053,7 @@ bits is set in MASK. `GL_INVALID_OPERATION' is generated if `glClear' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glClientActiveTexture (texture GLenum) -> void)) "Select active texture unit. @@ -2070,7 +2072,7 @@ called with a parameter of `GL_TEXTURE_COORD_ARRAY'. `GL_INVALID_ENUM' is generated if TEXTURE is not one of `GL_TEXTURE'I , where i ranges from 0 to the value of `GL_MAX_TEXTURE_COORDS' - 1.") -(define-gl-procedure +(define-foreign-procedure ((glClipPlane (plane GLenum) (equation *) -> void)) "Specify a plane against which all geometry is clipped. @@ -2113,7 +2115,7 @@ coordinates and are disabled. `GL_INVALID_OPERATION' is generated if `glClipPlane' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glColorMask (red GLboolean) (green GLboolean) @@ -2145,7 +2147,7 @@ changes are either enabled or disabled for entire color components. `GL_INVALID_OPERATION' is generated if `glColorMask' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glColorMaterial (face GLenum) (mode GLenum) @@ -2180,7 +2182,7 @@ initially disabled. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glColorPointer (size GLint) (type GLenum) @@ -2239,7 +2241,7 @@ the color array is used when `glDrawArrays', `glMultiDrawArrays', `GL_INVALID_VALUE' is generated if STRIDE is negative.") -(define-gl-procedure +(define-foreign-procedure ((glColorSubTable (target GLenum) (start GLsizei) @@ -2324,7 +2326,7 @@ indicated by TYPE. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glColorTable (target GLenum) (internalformat GLenum) @@ -2576,7 +2578,7 @@ indicated by TYPE. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glColor3i (red GLint) (green GLint) @@ -2656,7 +2658,7 @@ range [0,1] before the current color is updated. However, color components are clamped to this range before they are interpolated or written into a color buffer.") -(define-gl-procedure +(define-foreign-procedure ((glCompileShader (shader GLuint) -> void)) "Compiles a shader object. @@ -2687,7 +2689,7 @@ OpenGL. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glCompressedTexImage1D (target GLenum) (level GLint) @@ -2788,7 +2790,7 @@ Undefined results, including abnormal program termination, are generated if DATA is not encoded in a manner consistent with the extension specification defining the internal compression format.") -(define-gl-procedure +(define-foreign-procedure ((glCompressedTexImage2D (target GLenum) (level GLint) @@ -2904,7 +2906,7 @@ Undefined results, including abnormal program termination, are generated if DATA is not encoded in a manner consistent with the extension specification defining the internal compression format.") -(define-gl-procedure +(define-foreign-procedure ((glCompressedTexImage3D (target GLenum) (level GLint) @@ -3021,7 +3023,7 @@ Undefined results, including abnormal program termination, are generated if DATA is not encoded in a manner consistent with the extension specification defining the internal compression format.") -(define-gl-procedure +(define-foreign-procedure ((glCompressedTexSubImage1D (target GLenum) (level GLint) @@ -3115,7 +3117,7 @@ Undefined results, including abnormal program termination, are generated if DATA is not encoded in a manner consistent with the extension specification defining the internal compression format.") -(define-gl-procedure +(define-foreign-procedure ((glCompressedTexSubImage2D (target GLenum) (level GLint) @@ -3225,7 +3227,7 @@ Undefined results, including abnormal program termination, are generated if DATA is not encoded in a manner consistent with the extension specification defining the internal compression format.") -(define-gl-procedure +(define-foreign-procedure ((glCompressedTexSubImage3D (target GLenum) (level GLint) @@ -3334,7 +3336,7 @@ Undefined results, including abnormal program termination, are generated if DATA is not encoded in a manner consistent with the extension specification defining the internal compression format.") -(define-gl-procedure +(define-foreign-procedure ((glConvolutionFilter1D (target GLenum) (internalformat GLenum) @@ -3497,7 +3499,7 @@ indicated by TYPE. executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glConvolutionFilter2D (target GLenum) (internalformat GLenum) @@ -3671,7 +3673,7 @@ indicated by TYPE. executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glConvolutionParameterf (target GLenum) (pname GLenum) @@ -3752,7 +3754,7 @@ and PARAMS is not one of `GL_REDUCE', `GL_CONSTANT_BORDER', or executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glCopyColorSubTable (target GLenum) (start GLsizei) @@ -3800,7 +3802,7 @@ values. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glCopyColorTable (target GLenum) (internalformat GLenum) @@ -3910,7 +3912,7 @@ large to be supported by the implementation. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glCopyConvolutionFilter1D (target GLenum) (internalformat GLenum) @@ -4025,7 +4027,7 @@ than the maximum supported value. This value may be queried with executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glCopyConvolutionFilter2D (target GLenum) (internalformat GLenum) @@ -4151,7 +4153,7 @@ than the maximum supported value. This value may be queried with executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glCopyPixels (x GLint) (y GLint) @@ -4311,7 +4313,7 @@ no stencil buffer. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glCopyTexImage1D (target GLenum) (level GLint) @@ -4424,7 +4426,7 @@ between the execution of `glBegin' and the corresponding execution of `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or `GL_DEPTH_COMPONENT32' and there is no depth buffer.") -(define-gl-procedure +(define-foreign-procedure ((glCopyTexImage2D (target GLenum) (level GLint) @@ -4544,7 +4546,7 @@ between the execution of `glBegin' and the corresponding execution of `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or `GL_DEPTH_COMPONENT32' and there is no depth buffer.") -(define-gl-procedure +(define-foreign-procedure ((glCopyTexSubImage1D (target GLenum) (level GLint) @@ -4616,7 +4618,7 @@ the returned value of `GL_MAX_TEXTURE_SIZE'. `GL_TEXTURE_BORDER' of the texture image being modified. Note that W includes twice the border width.") -(define-gl-procedure +(define-foreign-procedure ((glCopyTexSubImage2D (target GLenum) (level GLint) @@ -4715,7 +4717,7 @@ H include twice the border width. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glCopyTexSubImage3D (target GLenum) (level GLint) @@ -4813,7 +4815,7 @@ the returned value of `GL_MAX_3D_TEXTURE_SIZE'. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glCreateProgram -> GLuint)) "Creates a program object. @@ -4842,7 +4844,7 @@ This function returns 0 if an error occurs creating the program object. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glCreateShader (shaderType GLenum) -> GLuint)) "Creates a shader object. @@ -4872,7 +4874,7 @@ This function returns 0 if an error occurs creating the shader object. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glCullFace (mode GLenum) -> void)) "Specify whether front- or back-facing facets can be culled. @@ -4895,7 +4897,7 @@ facets are front-facing and back-facing. See `glFrontFace'. `GL_INVALID_OPERATION' is generated if `glCullFace' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glDeleteBuffers (n GLsizei) (buffers *) -> void)) "Delete named buffer objects. @@ -4920,7 +4922,7 @@ to existing buffer objects. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glDeleteLists (list GLuint) (range GLsizei) @@ -4950,7 +4952,7 @@ ignored. If RANGE is 0, nothing happens. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glDeleteProgram (program GLuint) -> void)) "Deletes a program object. @@ -4979,7 +4981,7 @@ OpenGL. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glDeleteQueries (n GLsizei) (ids *) -> void)) "Delete named query objects. @@ -5002,7 +5004,7 @@ to existing query objects. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glDeleteShader (shader GLuint) -> void)) "Deletes a shader object. @@ -5029,7 +5031,7 @@ OpenGL. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glDeleteTextures (n GLsizei) (textures *) @@ -5058,7 +5060,7 @@ to existing textures. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glDepthFunc (func GLenum) -> void)) "Specify the value used for depth buffer comparisons. @@ -5115,7 +5117,7 @@ is as if the depth test always passes. `GL_INVALID_OPERATION' is generated if `glDepthFunc' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glDepthMask (flag GLboolean) -> void)) "Enable or disable writing into the depth buffer. @@ -5131,7 +5133,7 @@ is enabled. Initially, depth buffer writing is enabled. `GL_INVALID_OPERATION' is generated if `glDepthMask' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glDepthRange (nearVal GLclampd) (farVal GLclampd) @@ -5164,7 +5166,7 @@ With this mapping, the depth buffer range is fully utilized. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glDetachShader (program GLuint) (shader GLuint) @@ -5201,7 +5203,7 @@ PROGRAM. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glDrawArrays (mode GLenum) (first GLint) @@ -5252,7 +5254,7 @@ currently mapped. `GL_INVALID_OPERATION' is generated if `glDrawArrays' is executed between the execution of `glBegin' and the corresponding `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glDrawBuffers (n GLsizei) (bufs *) -> void)) "Specifies a list of color buffers to be drawn into. @@ -5326,7 +5328,7 @@ current GL context. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glDrawBuffer (mode GLenum) -> void)) "Specify which color buffers are to be drawn into. @@ -5409,7 +5411,7 @@ MODE exists. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glDrawElements (mode GLenum) (count GLsizei) @@ -5466,7 +5468,7 @@ data store is currently mapped. `GL_INVALID_OPERATION' is generated if `glDrawElements' is executed between the execution of `glBegin' and the corresponding `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glDrawPixels (width GLsizei) (height GLsizei) @@ -5875,7 +5877,7 @@ indicated by TYPE. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glDrawRangeElements (mode GLenum) (start GLuint) @@ -5954,7 +5956,7 @@ data store is currently mapped. `GL_INVALID_OPERATION' is generated if `glDrawRangeElements' is executed between the execution of `glBegin' and the corresponding `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glEdgeFlagPointer (stride GLsizei) (pointer *) @@ -5995,7 +5997,7 @@ enabled, the edge flag array is used when `glDrawArrays', `GL_INVALID_ENUM' is generated if STRIDE is negative.") -(define-gl-procedure +(define-foreign-procedure ((glEdgeFlag (flag GLboolean) -> void)) "Flag edges as either boundary or nonboundary. @@ -6018,7 +6020,7 @@ Boundary and nonboundary edge flags on vertices are significant only if `GL_POLYGON_MODE' is set to `GL_POINT' or `GL_LINE'. See `glPolygonMode'.") -(define-gl-procedure +(define-foreign-procedure ((glEnableClientState (cap GLenum) -> void) (glDisableClientState (cap GLenum) -> void)) "Enable or disable client-side capability. @@ -6089,7 +6091,7 @@ of the following values: and the corresponding `glEnd', but an error may or may not be generated. If no error is generated, the behavior is undefined.") -(define-gl-procedure +(define-foreign-procedure ((glEnableVertexAttribArray (index GLuint) -> @@ -6121,7 +6123,7 @@ array commands such as `glDrawArrays', `glDrawElements', ' or `glDisableVertexAttribArray ' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glEnable (cap GLenum) -> void) (glDisable (cap GLenum) -> void)) "Enable or disable server-side GL capabilities. @@ -6588,7 +6590,7 @@ previously. executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glEvalCoord1d (u GLdouble) -> void) (glEvalCoord2d (u GLdouble) (v GLdouble) -> void)) "Evaluate enabled one- and two-dimensional maps. @@ -6654,7 +6656,7 @@ If automatic normal generation is disabled, the corresponding normal map automatic normal generation nor a normal map is enabled, no normal is generated for `glEvalCoord2' commands.") -(define-gl-procedure +(define-foreign-procedure ((glEvalMesh1 (mode GLenum) (i1 GLint) @@ -6781,7 +6783,7 @@ I=N , then the value computed from I·ΔU+U_1 is exactly U_2 , and if J=M `GL_INVALID_OPERATION' is generated if `glEvalMesh' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glEvalPoint1 (i GLint) -> void) (glEvalPoint2 (i GLint) (j GLint) -> void)) "Generate and evaluate a single point in a mesh. @@ -6823,7 +6825,7 @@ I=N , then the value computed from I·ΔU+U_1 is exactly U_2 , and if J=M );") -(define-gl-procedure +(define-foreign-procedure ((glFeedbackBuffer (size GLsizei) (type GLenum) @@ -6955,7 +6957,7 @@ once. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glFinish -> void)) "Block until all GL execution is complete. @@ -6967,7 +6969,7 @@ contents. `GL_INVALID_OPERATION' is generated if `glFinish' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glFlush -> void)) "Force execution of GL commands in finite time. @@ -6987,7 +6989,7 @@ that depends on the generated image. `GL_INVALID_OPERATION' is generated if `glFlush' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glFogCoordPointer (type GLenum) (stride GLsizei) @@ -7039,7 +7041,7 @@ called. `GL_INVALID_VALUE' is generated if STRIDE is negative.") -(define-gl-procedure +(define-foreign-procedure ((glFogCoordd (coord GLdouble) -> void)) "Set the current fog coordinates. @@ -7050,7 +7052,7 @@ COORD vertex and the current raster position. The value specified is interpolated and used in computing the fog color (see `glFog').") -(define-gl-procedure +(define-foreign-procedure ((glFogf (pname GLenum) (param GLfloat) -> void) (glFogi (pname GLenum) (param GLint) -> void)) "Specify fog parameters. @@ -7149,7 +7151,7 @@ is negative. `GL_INVALID_OPERATION' is generated if `glFog' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glFrontFace (mode GLenum) -> void)) "Define front- and back-facing polygons. @@ -7182,7 +7184,7 @@ taken to be front-facing. `GL_INVALID_OPERATION' is generated if `glFrontFace' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glFrustum (left GLdouble) (right GLdouble) @@ -7248,7 +7250,7 @@ if LEFT = RIGHT, or BOTTOM = TOP, or NEAR = FAR. `GL_INVALID_OPERATION' is generated if `glFrustum' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGenBuffers (n GLsizei) (buffers *) -> void)) "Generate buffer object names. @@ -7277,7 +7279,7 @@ until they are first bound by calling `glBindBuffer'. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGenLists (range GLsizei) -> GLuint)) "Generate a contiguous set of empty display lists. @@ -7296,7 +7298,7 @@ generated, and 0 is returned. `GL_INVALID_OPERATION' is generated if `glGenLists' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGenQueries (n GLsizei) (ids *) -> void)) "Generate query object names. @@ -7325,7 +7327,7 @@ until they are first used by calling `glBeginQuery'. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGenTextures (n GLsizei) (textures *) -> void)) "Generate texture names. @@ -7353,7 +7355,7 @@ subsequent calls, unless they are first deleted with `glDeleteTextures'. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGetActiveAttrib (program GLuint) (index GLuint) @@ -7460,7 +7462,7 @@ between the execution of `glBegin' and the corresponding execution of `GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.") -(define-gl-procedure +(define-foreign-procedure ((glGetActiveUniform (program GLuint) (index GLuint) @@ -7591,7 +7593,7 @@ between the execution of `glBegin' and the corresponding execution of `GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.") -(define-gl-procedure +(define-foreign-procedure ((glGetAttachedShaders (program GLuint) (maxCount GLsizei) @@ -7640,7 +7642,7 @@ OpenGL. executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGetAttribLocation (program GLuint) (name *) @@ -7688,7 +7690,7 @@ linked. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGetBufferSubData (target GLenum) (offset GLintptr) @@ -7740,7 +7742,7 @@ is mapped. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGetClipPlane (plane GLenum) (equation *) @@ -7769,7 +7771,7 @@ equation for PLANE. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGetColorTable (target GLenum) (format GLenum) @@ -7879,7 +7881,7 @@ indicated by TYPE. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGetCompressedTexImage (target GLenum) (lod GLint) @@ -7947,7 +7949,7 @@ the data store size. executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGetConvolutionFilter (target GLenum) (format GLenum) @@ -8057,7 +8059,7 @@ indicated by TYPE. executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGetError -> GLenum)) "Return error information. @@ -8127,7 +8129,7 @@ returns 0. If `glGetError' itself generates an error, it returns 0. the execution of `glBegin' and the corresponding execution of `glEnd'. In this case, `glGetError' returns 0.") -(define-gl-procedure +(define-foreign-procedure ((glGetHistogram (target GLenum) (reset GLboolean) @@ -8238,7 +8240,7 @@ indicated by TYPE. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGetMinmax (target GLenum) (reset GLboolean) @@ -8357,7 +8359,7 @@ indicated by TYPE. `GL_INVALID_OPERATION' is generated if `glGetMinmax' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGetPolygonStipple (pattern *) -> void)) "Return the polygon stipple pattern. @@ -8390,7 +8392,7 @@ the data store size. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGetProgramInfoLog (program GLuint) (maxLength GLsizei) @@ -8447,7 +8449,7 @@ OpenGL. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGetSeparableFilter (target GLenum) (format GLenum) @@ -8567,7 +8569,7 @@ datum indicated by TYPE. executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGetShaderInfoLog (shader GLuint) (maxLength GLsizei) @@ -8621,7 +8623,7 @@ OpenGL. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGetShaderSource (shader GLuint) (bufSize GLsizei) @@ -8671,7 +8673,7 @@ OpenGL. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGetString (name GLenum) -> *)) "Return a string describing the current GL connection. @@ -8740,7 +8742,7 @@ All strings are null-terminated. `GL_INVALID_OPERATION' is generated if `glGetString' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGetTexImage (target GLenum) (level GLint) @@ -8864,7 +8866,7 @@ indicated by TYPE. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glGetUniformLocation (program GLuint) (name *) @@ -8921,7 +8923,7 @@ linked. executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glHint (target GLenum) (mode GLenum) -> void)) "Specify implementation-specific hints. @@ -9031,7 +9033,7 @@ accepted value. `GL_INVALID_OPERATION' is generated if `glHint' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glHistogram (target GLenum) (width GLsizei) @@ -9112,7 +9114,7 @@ histogram table specified is too large for the implementation. `GL_INVALID_OPERATION' is generated if `glHistogram' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glIndexMask (mask GLuint) -> void)) "Control the writing of individual bits in the color index buffers. @@ -9135,7 +9137,7 @@ all bits are enabled for writing. `GL_INVALID_OPERATION' is generated if `glIndexMask' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glIndexPointer (type GLenum) (stride GLsizei) @@ -9185,7 +9187,7 @@ enabled, the color index array is used when `glDrawArrays', `GL_INVALID_VALUE' is generated if STRIDE is negative.") -(define-gl-procedure +(define-foreign-procedure ((glIndexi (c GLint) -> void) (glIndexd (c GLdouble) -> void) (glIndexub (c GLubyte) -> void)) @@ -9209,7 +9211,7 @@ written to the frame buffer, it is converted to fixed-point format. Any bits in the integer portion of the resulting fixed-point value that do not correspond to bits in the frame buffer are masked out.") -(define-gl-procedure +(define-foreign-procedure ((glInitNames -> void)) "Initialize the name stack. @@ -9225,7 +9227,7 @@ ignored. `GL_INVALID_OPERATION' is generated if `glInitNames' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glInterleavedArrays (format GLenum) (stride GLsizei) @@ -9269,7 +9271,7 @@ located at the first possible floating-point aligned address. `GL_INVALID_VALUE' is generated if STRIDE is negative.") -(define-gl-procedure +(define-foreign-procedure ((glIsBuffer (buffer GLuint) -> GLboolean)) "Determine if a name corresponds to a buffer object. @@ -9287,7 +9289,7 @@ object by calling `glBindBuffer', is not the name of a buffer object. `GL_INVALID_OPERATION' is generated if `glIsBuffer' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glIsEnabled (cap GLenum) -> GLboolean)) "Test whether a capability is enabled. @@ -9531,7 +9533,7 @@ The following capabilities are accepted for CAP: `GL_INVALID_OPERATION' is generated if `glIsEnabled' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glIsList (list GLuint) -> GLboolean)) "Determine if a name corresponds to a display list. @@ -9547,7 +9549,7 @@ list by calling `glNewList', is not the name of a display list. `GL_INVALID_OPERATION' is generated if `glIsList' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glIsProgram (program GLuint) -> GLboolean)) "Determines if a name corresponds to a program object. @@ -9563,7 +9565,7 @@ returns `GL_FALSE'. `GL_INVALID_OPERATION' is generated if `glIsProgram' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glIsQuery (id GLuint) -> GLboolean)) "Determine if a name corresponds to a query object. @@ -9581,7 +9583,7 @@ object by calling `glBeginQuery', is not the name of a query object. `GL_INVALID_OPERATION' is generated if `glIsQuery' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glIsShader (shader GLuint) -> GLboolean)) "Determines if a name corresponds to a shader object. @@ -9597,7 +9599,7 @@ name of a shader object, or if an error occurs, `glIsShader ' returns `GL_INVALID_OPERATION' is generated if `glIsShader' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glIsTexture (texture GLuint) -> GLboolean)) "Determine if a name corresponds to a texture. @@ -9615,7 +9617,7 @@ texture by calling `glBindTexture', is not the name of a texture. `GL_INVALID_OPERATION' is generated if `glIsTexture' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glLightModelf (pname GLenum) (param GLfloat) @@ -9728,7 +9730,7 @@ RGBA case, determine how much above ambient the resulting index is. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glLightf (light GLenum) (pname GLenum) @@ -9880,7 +9882,7 @@ attenuation factor is specified. `GL_INVALID_OPERATION' is generated if `glLight' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glLineStipple (factor GLint) (pattern GLushort) @@ -9930,7 +9932,7 @@ were all 1's. Initially, line stippling is disabled. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glLineWidth (width GLfloat) -> void)) "Specify the width of rasterized lines. @@ -9972,7 +9974,7 @@ between supported widths within the range, call `glGet' with arguments `GL_INVALID_OPERATION' is generated if `glLineWidth' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glLinkProgram (program GLuint) -> void)) "Links a program object. @@ -10070,7 +10072,7 @@ OpenGL. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glListBase (base GLuint) -> void)) "Set the display-list base for . @@ -10085,7 +10087,7 @@ display lists are executed; the others are ignored. `GL_INVALID_OPERATION' is generated if `glListBase' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glLoadIdentity -> void)) "Replace the current matrix with the identity matrix. @@ -10105,7 +10107,7 @@ but in some cases it is more efficient. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glLoadMatrixd (m *) -> void)) "Replace the current matrix with the specified matrix. @@ -10137,7 +10139,7 @@ Projection and texture transformations are similarly defined. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glLoadName (name GLuint) -> void)) "Load a name onto the name stack. @@ -10161,7 +10163,7 @@ name stack is empty. `GL_INVALID_OPERATION' is generated if `glLoadName' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glLoadTransposeMatrixd (m *) -> void)) "Replace the current matrix with the specified row-major ordered matrix. @@ -10196,7 +10198,7 @@ to `glLoadMatrix' with M^T , where T represents the transpose. executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glLogicOp (opcode GLenum) -> void)) "Specify a logical pixel operation for color index rendering. @@ -10281,7 +10283,7 @@ source and destination indices or colors. `GL_INVALID_OPERATION' is generated if `glLogicOp' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glMap1d (target GLenum) (u1 GLdouble) @@ -10442,7 +10444,7 @@ execution of `glBegin' and the corresponding execution of `glEnd'. `GL_INVALID_OPERATION' is generated if `glMap1' is called and the value of `GL_ACTIVE_TEXTURE' is not `GL_TEXTURE0'.") -(define-gl-procedure +(define-foreign-procedure ((glMap2d (target GLenum) (u1 GLdouble) @@ -10641,7 +10643,7 @@ execution of `glBegin' and the corresponding execution of `glEnd'. `GL_INVALID_OPERATION' is generated if `glMap2' is called and the value of `GL_ACTIVE_TEXTURE' is not `GL_TEXTURE0'.") -(define-gl-procedure +(define-foreign-procedure ((glMapBuffer (target GLenum) (access GLenum) @@ -10719,7 +10721,7 @@ buffer object whose data store is not currently mapped. is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glMapGrid1d (un GLint) (u1 GLdouble) @@ -10791,7 +10793,7 @@ The mappings specified by `glMapGrid' are used identically by `GL_INVALID_OPERATION' is generated if `glMapGrid' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glMaterialf (face GLenum) (pname GLenum) @@ -10899,7 +10901,7 @@ accepted value. `GL_INVALID_VALUE' is generated if a specular exponent outside the range [0,128] is specified.") -(define-gl-procedure +(define-foreign-procedure ((glMatrixMode (mode GLenum) -> void)) "Specify which matrix is the current matrix. @@ -10936,7 +10938,7 @@ value is `GL_MODELVIEW'. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glMinmax (target GLenum) (internalformat GLenum) @@ -11001,7 +11003,7 @@ allowable values. `GL_INVALID_OPERATION' is generated if `glMinmax' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glMultiDrawArrays (mode GLenum) (first *) @@ -11059,7 +11061,7 @@ currently mapped. `GL_INVALID_OPERATION' is generated if `glMultiDrawArrays' is executed between the execution of `glBegin' and the corresponding `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glMultiDrawElements (mode GLenum) (count *) @@ -11117,7 +11119,7 @@ data store is currently mapped. `GL_INVALID_OPERATION' is generated if `glMultiDrawElements' is executed between the execution of `glBegin' and the corresponding `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glMultiTexCoord1i (target GLenum) (s GLint) @@ -11200,7 +11202,7 @@ The current texture coordinates are part of the data that is associated with each vertex and with the current raster position. Initially, the values for (S,TRQ) are (0,001) .") -(define-gl-procedure +(define-foreign-procedure ((glMultMatrixd (m *) -> void)) "Multiply the current matrix with the specified matrix. @@ -11219,7 +11221,7 @@ or the texture matrix. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glMultTransposeMatrixd (m *) -> void)) "Multiply the current matrix with the specified row-major ordered matrix. @@ -11238,7 +11240,7 @@ or the texture matrix. executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glNewList (list GLuint) (mode GLenum) -> void) (glEndList -> void)) "Create or replace a display list. @@ -11316,7 +11318,7 @@ is made to the previous contents of the display list, if any, and no other change is made to the GL state. (It is as if no attempt had been made to create the new display list.)") -(define-gl-procedure +(define-foreign-procedure ((glNormalPointer (type GLenum) (stride GLsizei) @@ -11366,7 +11368,7 @@ the normal array is used when `glDrawArrays', `glMultiDrawArrays', `GL_INVALID_VALUE' is generated if STRIDE is negative.") -(define-gl-procedure +(define-foreign-procedure ((glNormal3d (nx GLdouble) (ny GLdouble) @@ -11409,7 +11411,7 @@ normalization, call `glEnable' and `glDisable' with either `GL_NORMALIZE' or `GL_RESCALE_NORMAL'. Normalization is initially disabled.") -(define-gl-procedure +(define-foreign-procedure ((glOrtho (left GLdouble) (right GLdouble) @@ -11467,7 +11469,7 @@ NEAR = FAR. `GL_INVALID_OPERATION' is generated if `glOrtho' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glPassThrough (token GLfloat) -> void)) "Place a marker in the feedback buffer. @@ -11494,7 +11496,7 @@ respect to the specification of graphics primitives is maintained. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glPixelStoref (pname GLenum) (param GLfloat) @@ -11794,7 +11796,7 @@ row skip value is specified, or if alignment is specified as other than between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glPixelTransferf (pname GLenum) (param GLfloat) @@ -12080,7 +12082,7 @@ assigned to real-valued parameters. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glPixelZoom (xfactor GLfloat) (yfactor GLfloat) @@ -12112,7 +12114,7 @@ factors reflect the resulting image about the current raster position. `GL_INVALID_OPERATION' is generated if `glPixelZoom' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glPointParameterf (pname GLenum) (param GLfloat) @@ -12180,7 +12182,7 @@ If the value for `GL_POINT_SIZE_MIN' is greater than `GL_POINT_SIZE_MAX', the point size after clamping is undefined, but no error is generated.") -(define-gl-procedure +(define-foreign-procedure ((glPointSize (size GLfloat) -> void)) "Specify the diameter of rasterized points. @@ -12265,7 +12267,7 @@ supported ranges and granularity with `glGet' with arguments `GL_INVALID_OPERATION' is generated if `glPointSize' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glPolygonMode (face GLenum) (mode GLenum) @@ -12321,7 +12323,7 @@ value. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glPolygonOffset (factor GLfloat) (units GLfloat) @@ -12355,7 +12357,7 @@ edges. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glPolygonStipple (pattern *) -> void)) "Set the polygon stippling pattern. @@ -12404,7 +12406,7 @@ would exceed the data store size. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glPrioritizeTextures (n GLsizei) (textures *) @@ -12455,7 +12457,7 @@ bound. This is the only way to set the priority of a default texture. executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glPushAttrib (mask GLbitfield) -> void) (glPopAttrib -> void)) "Push and pop the server attribute stack. @@ -12960,7 +12962,7 @@ attribute stack is empty. is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glPushClientAttrib (mask GLbitfield) -> void) (glPopClientAttrib -> void)) "Push and pop the client attribute stack. @@ -12998,7 +13000,7 @@ the attribute stack is full. `GL_STACK_UNDERFLOW' is generated if `glPopClientAttrib' is called while the attribute stack is empty.") -(define-gl-procedure +(define-foreign-procedure ((glPushMatrix -> void) (glPopMatrix -> void)) "Push and pop the current matrix stack. @@ -13031,7 +13033,7 @@ current matrix stack contains only a single matrix. is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glPushName (name GLuint) -> void) (glPopName -> void)) "Push and pop the name stack. @@ -13068,7 +13070,7 @@ name stack is empty. executed between a call to `glBegin' and the corresponding call to `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glRasterPos2i (x GLint) (y GLint) -> void) (glRasterPos2d (x GLdouble) (y GLdouble) -> void) (glRasterPos3i @@ -13158,7 +13160,7 @@ raster RGBA color always maintains its initial value. `GL_INVALID_OPERATION' is generated if `glRasterPos' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glReadBuffer (mode GLenum) -> void)) "Select a color buffer source for pixels. @@ -13196,7 +13198,7 @@ not exist. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glReadPixels (x GLint) (y GLint) @@ -13449,7 +13451,7 @@ indicated by TYPE. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glRectd (x1 GLdouble) (y1 GLdouble) @@ -13498,7 +13500,7 @@ winding. `GL_INVALID_OPERATION' is generated if `glRect' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glRenderMode (mode GLenum) -> GLint)) "Set rasterization mode. @@ -13563,7 +13565,7 @@ once. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glResetHistogram (target GLenum) -> void)) "Reset histogram table entries to zero. @@ -13579,7 +13581,7 @@ table to zero. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glResetMinmax (target GLenum) -> void)) "Reset minmax table entries to initial values. @@ -13597,7 +13599,7 @@ possible component values. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glRotated (angle GLdouble) (x GLdouble) @@ -13642,7 +13644,7 @@ and `glPopMatrix' to save and restore the unrotated coordinate system. `GL_INVALID_OPERATION' is generated if `glRotate' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glSampleCoverage (value GLclampf) (invert GLboolean) @@ -13684,7 +13686,7 @@ each sample. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glScaled (x GLdouble) (y GLdouble) @@ -13719,7 +13721,7 @@ coordinate system. `GL_INVALID_OPERATION' is generated if `glScale' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glScissor (x GLint) (y GLint) @@ -13763,7 +13765,7 @@ includes the entire window. `GL_INVALID_OPERATION' is generated if `glScissor' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glSecondaryColorPointer (size GLint) (type GLenum) @@ -13822,7 +13824,7 @@ called. `GL_INVALID_VALUE' is generated if STRIDE is negative.") -(define-gl-procedure +(define-foreign-procedure ((glSecondaryColor3i (red GLint) (green GLint) @@ -13885,7 +13887,7 @@ range [0,1] before the current color is updated. However, color components are clamped to this range before they are interpolated or written into a color buffer.") -(define-gl-procedure +(define-foreign-procedure ((glSelectBuffer (size GLsizei) (buffer *) @@ -13952,7 +13954,7 @@ argument `GL_SELECT' before `glSelectBuffer' is called at least once. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glSeparableFilter2D (target GLenum) (internalformat GLenum) @@ -14131,7 +14133,7 @@ datum indicated by TYPE. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glShadeModel (mode GLenum) -> void)) "Select flat or smooth shading. @@ -14192,7 +14194,7 @@ or `GL_SMOOTH'. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glShaderSource (shader GLuint) (count GLsizei) @@ -14240,7 +14242,7 @@ OpenGL. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glStencilFuncSeparate (face GLenum) (func GLenum) @@ -14340,7 +14342,7 @@ values. executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glStencilFunc (func GLenum) (ref GLint) @@ -14434,7 +14436,7 @@ values. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glStencilMaskSeparate (face GLenum) (mask GLuint) @@ -14469,7 +14471,7 @@ with FACE set to `GL_FRONT_AND_BACK'. executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glStencilMask (mask GLuint) -> void)) "Control the front and back writing of individual bits in the stencil planes. @@ -14495,7 +14497,7 @@ and back stencil writemasks to different values. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glStencilOpSeparate (face GLenum) (sfail GLenum) @@ -14605,7 +14607,7 @@ other than the eight defined constant values. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glStencilOp (sfail GLenum) (dpfail GLenum) @@ -14706,7 +14708,7 @@ other than the eight defined constant values. `GL_INVALID_OPERATION' is generated if `glStencilOp' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glTexCoordPointer (size GLint) (type GLenum) @@ -14767,7 +14769,7 @@ called. `GL_INVALID_VALUE' is generated if STRIDE is negative.") -(define-gl-procedure +(define-foreign-procedure ((glTexCoord1i (s GLint) -> void) (glTexCoord1d (s GLdouble) -> void) (glTexCoord2i (s GLint) (t GLint) -> void) @@ -14820,7 +14822,7 @@ The current texture coordinates are part of the data that is associated with each vertex and with the current raster position. Initially, the values for S, T, R, and Q are (0, 0, 0, 1).") -(define-gl-procedure +(define-foreign-procedure ((glTexEnvf (target GLenum) (pname GLenum) @@ -15174,7 +15176,7 @@ or `GL_ALPHA_SCALE' are not one of 1.0, 2.0, or 4.0. `GL_INVALID_OPERATION' is generated if `glTexEnv' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glTexGeni (coord GLenum) (pname GLenum) @@ -15290,7 +15292,7 @@ PARAMS is `GL_SPHERE_MAP', and COORD is either `GL_R' or `GL_Q'. `GL_INVALID_OPERATION' is generated if `glTexGen' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glTexImage1D (target GLenum) (level GLint) @@ -15612,7 +15614,7 @@ indicated by TYPE. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glTexImage2D (target GLenum) (level GLint) @@ -15961,7 +15963,7 @@ indicated by TYPE. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glTexImage3D (target GLenum) (level GLint) @@ -16283,7 +16285,7 @@ indicated by TYPE. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glTexParameterf (target GLenum) (pname GLenum) @@ -16567,7 +16569,7 @@ value (based on the value of PNAME) and does not. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glTexSubImage1D (target GLenum) (level GLint) @@ -16688,7 +16690,7 @@ indicated by TYPE. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glTexSubImage2D (target GLenum) (level GLint) @@ -16826,7 +16828,7 @@ indicated by TYPE. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glTexSubImage3D (target GLenum) (level GLint) @@ -16969,7 +16971,7 @@ indicated by TYPE. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glTranslated (x GLdouble) (y GLdouble) @@ -17003,7 +17005,7 @@ untranslated coordinate system. `GL_INVALID_OPERATION' is generated if `glTranslate' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glUniform1f (location GLint) (v0 GLfloat) @@ -17157,7 +17159,7 @@ command other than `glUniform1i' and `glUniform1iv'. `GL_INVALID_OPERATION' is generated if `glUniform' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glUseProgram (program GLuint) -> void)) "Installs a program object as part of current rendering state. @@ -17256,7 +17258,7 @@ current state. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glValidateProgram (program GLuint) -> void)) "Validates a program object. @@ -17295,7 +17297,7 @@ OpenGL. between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glVertexAttribPointer (index GLuint) (size GLint) @@ -17373,7 +17375,7 @@ If enabled, the generic vertex attribute array is used when `GL_INVALID_VALUE' is generated if STRIDE is negative.") -(define-gl-procedure +(define-foreign-procedure ((glVertexAttrib1s (index GLuint) (v0 GLshort) @@ -17521,7 +17523,7 @@ attributes. `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to `GL_MAX_VERTEX_ATTRIBS'.") -(define-gl-procedure +(define-foreign-procedure ((glVertexPointer (size GLint) (type GLenum) @@ -17579,7 +17581,7 @@ the vertex array is used when `glArrayElement', `glDrawArrays', `GL_INVALID_VALUE' is generated if STRIDE is negative.") -(define-gl-procedure +(define-foreign-procedure ((glVertex2i (x GLint) (y GLint) -> void) (glVertex2d (x GLdouble) (y GLdouble) -> void) (glVertex3i @@ -17628,7 +17630,7 @@ coordinates, and fog coordinate are associated with the vertex when When only X and Y are specified, Z defaults to 0 and W defaults to 1. When X , Y , and Z are specified, W defaults to 1.") -(define-gl-procedure +(define-foreign-procedure ((glViewport (x GLint) (y GLint) @@ -17669,7 +17671,7 @@ on the implementation. To query this range, call `glGet' with argument `GL_INVALID_OPERATION' is generated if `glViewport' is executed between the execution of `glBegin' and the corresponding execution of `glEnd'.") -(define-gl-procedure +(define-foreign-procedure ((glWindowPos2i (x GLint) (y GLint) -> void) (glWindowPos2d (x GLdouble) (y GLdouble) -> void) (glWindowPos3i diff --git a/figl/low-level/types.scm b/figl/gl/types.scm similarity index 97% rename from figl/low-level/types.scm rename to figl/gl/types.scm index d83ffe1..00cf14e 100644 --- a/figl/low-level/types.scm +++ b/figl/gl/types.scm @@ -21,8 +21,9 @@ ;; ;;; Code: -(define-module (figl low-level types) +(define-module (figl gl types) #:use-module (system foreign) + #:re-export (void) #:export (GLboolean GLbyte GLubyte diff --git a/figl/low-level/glu.scm b/figl/glu/low-level.scm similarity index 98% rename from figl/low-level/glu.scm rename to figl/glu/low-level.scm index 4c08206..23bcebc 100644 --- a/figl/low-level/glu.scm +++ b/figl/glu/low-level.scm @@ -26,9 +26,11 @@ ;;; (define-module - (figl low-level glu) + (figl glu low-level) #:use-module - (figl low-level support) + (figl runtime) + #:use-module + (figl glu types) #:export (gluBeginCurve gluEndCurve @@ -90,7 +92,7 @@ gluUnProject4 gluUnProject)) -(define-gl-procedure +(define-foreign-procedure ((gluBeginCurve (nurb *) -> void) (gluEndCurve (nurb *) -> void)) "Delimit a NURBS curve definition. @@ -111,7 +113,7 @@ segments. Evaluator state is preserved during rendering with `glPushAttrib' reference page for details on exactly what state these calls preserve.") -(define-gl-procedure +(define-foreign-procedure ((gluBeginPolygon (tess *) -> void) (gluEndPolygon (tess *) -> void)) "Delimit a polygon description. @@ -131,7 +133,7 @@ Once `gluEndPolygon' is called, the polygon is tessellated, and the resulting triangles are described through callbacks. See `gluTessCallback' for descriptions of the callback functions.") -(define-gl-procedure +(define-foreign-procedure ((gluBeginSurface (nurb *) -> void) (gluEndSurface (nurb *) -> void)) "Delimit a NURBS surface definition. @@ -155,7 +157,7 @@ Evaluator state is preserved during rendering with `glPushAttrib'(`GLU_EVAL_BIT') and `glPopAttrib'. See the `glPushAttrib' reference page for details on exactly what state these calls preserve.") -(define-gl-procedure +(define-foreign-procedure ((gluBeginTrim (nurb *) -> void) (gluEndTrim (nurb *) -> void)) "Delimit a NURBS trimming loop definition. @@ -210,7 +212,7 @@ self-intersecting, or intersect one another, an error results. If no trimming information is given for a NURBS surface, the entire surface is drawn.") -(define-gl-procedure +(define-foreign-procedure ((gluBuild1DMipmapLevels (target GLenum) (internalFormat GLint) @@ -345,7 +347,7 @@ is neither `GLU_RGBA' nor `GLU_BGRA'. `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.") -(define-gl-procedure +(define-foreign-procedure ((gluBuild1DMipmaps (target GLenum) (internalFormat GLint) @@ -468,7 +470,7 @@ is neither `GLU_RGBA' nor `GLU_BGRA'. `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.") -(define-gl-procedure +(define-foreign-procedure ((gluBuild2DMipmapLevels (target GLenum) (internalFormat GLint) @@ -609,7 +611,7 @@ is neither `GLU_RGBA' nor `GLU_BGRA'. `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.") -(define-gl-procedure +(define-foreign-procedure ((gluBuild2DMipmaps (target GLenum) (internalFormat GLint) @@ -742,7 +744,7 @@ is neither `GLU_RGBA' nor `GLU_BGRA'. `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.") -(define-gl-procedure +(define-foreign-procedure ((gluBuild3DMipmapLevels (target GLenum) (internalFormat GLint) @@ -886,7 +888,7 @@ is neither `GLU_RGBA' nor `GLU_BGRA'. `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.") -(define-gl-procedure +(define-foreign-procedure ((gluBuild3DMipmaps (target GLenum) (internalFormat GLint) @@ -1021,7 +1023,7 @@ is neither `GLU_RGBA' nor `GLU_BGRA'. `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.") -(define-gl-procedure +(define-foreign-procedure ((gluCheckExtension (extName *) (extString *) @@ -1043,7 +1045,7 @@ names by passing the extension strings returned by `glGetString', `gluGetString', `glXGetClientString', `glXQueryExtensionsString', or `glXQueryServerString', respectively, as EXTSTRING.") -(define-gl-procedure +(define-foreign-procedure ((gluCylinder (quad *) (base GLdouble) @@ -1090,7 +1092,7 @@ coordinates are generated so that T ranges linearly from 0.0 at Z = 0 to +X axis, to 0.5 at the -Y axis, to 0.75 at the \\-X axis, and back to 1.0 at the +Y axis.") -(define-gl-procedure +(define-foreign-procedure ((gluDeleteNurbsRenderer (nurb *) -> void)) "Destroy a NURBS object. @@ -1101,7 +1103,7 @@ NURB with `gluNewNurbsRenderer') and frees any memory it uses. Once `gluDeleteNurbsRenderer' has been called, NURB cannot be used again.") -(define-gl-procedure +(define-foreign-procedure ((gluDeleteQuadric (quad *) -> void)) "Destroy a quadrics object. @@ -1112,7 +1114,7 @@ QUAD `gluNewQuadric') and frees any memory it uses. Once `gluDeleteQuadric' has been called, QUAD cannot be used again.") -(define-gl-procedure +(define-foreign-procedure ((gluDeleteTess (tess *) -> void)) "Destroy a tessellation object. @@ -1122,7 +1124,7 @@ TESS `gluDeleteTess' destroys the indicated tessellation object (which was created with `gluNewTess') and frees any memory that it used.") -(define-gl-procedure +(define-foreign-procedure ((gluDisk (quad *) (inner GLdouble) @@ -1165,7 +1167,7 @@ coordinates are generated linearly such that where R=OUTER , the value at (R, 0, 0) is (1, 0.5), at (0, R, 0) it is (0.5, 1), at (\\-R, 0, 0) it is (0, 0.5), and at (0, \\-R, 0) it is (0.5, 0).") -(define-gl-procedure +(define-foreign-procedure ((gluErrorString (error GLenum) -> *)) "Produce an error string from a GL or GLU error code. @@ -1183,7 +1185,7 @@ functions can return specialized error codes through callbacks. See the `NULL' is returned if ERROR is not a valid GL or GLU error code.") -(define-gl-procedure +(define-foreign-procedure ((gluGetNurbsProperty (nurb *) (property GLenum) @@ -1211,7 +1213,7 @@ These properties affect the way that NURBS curves and surfaces are rendered. See the `gluNurbsProperty' reference page for information about what the properties are and what they do.") -(define-gl-procedure +(define-foreign-procedure ((gluGetString (name GLenum) -> *)) "Return a string describing the GLU version or GLU extensions . @@ -1243,7 +1245,7 @@ All strings are null-terminated. NULL is returned if NAME is not `GLU_VERSION' or `GLU_EXTENSIONS'.") -(define-gl-procedure +(define-foreign-procedure ((gluGetTessProperty (tess *) (which GLenum) @@ -1269,7 +1271,7 @@ object. These properties affect the way that tessellation objects are interpreted and rendered. See the `gluTessProperty' reference page for information about the properties and what they do.") -(define-gl-procedure +(define-foreign-procedure ((gluLoadSamplingMatrices (nurb *) (model *) @@ -1306,7 +1308,7 @@ property turned on, there can be a performance penalty for doing so. (A round trip to the GL server is needed to fetch the current values of the modelview matrix, projection matrix, and viewport.)") -(define-gl-procedure +(define-foreign-procedure ((gluLookAt (eyeX GLdouble) (eyeY GLdouble) @@ -1380,7 +1382,7 @@ and `gluLookAt' is equivalent to glMultMatrixf(M); glTranslated(-eyex, -eyey, -eyez);") -(define-gl-procedure +(define-foreign-procedure ((gluNewNurbsRenderer -> *)) "Create a NURBS object. @@ -1389,7 +1391,7 @@ object. This object must be referred to when calling NURBS rendering and control functions. A return value of 0 means that there is not enough memory to allocate the object.") -(define-gl-procedure +(define-foreign-procedure ((gluNewQuadric -> *)) "Create a quadrics object. @@ -1398,7 +1400,7 @@ This object must be referred to when calling quadrics rendering and control functions. A return value of 0 means that there is not enough memory to allocate the object.") -(define-gl-procedure +(define-foreign-procedure ((gluNewTess -> *)) "Create a tessellation object. @@ -1407,7 +1409,7 @@ This object must be referred to when calling tessellation functions. A return value of 0 means that there is not enough memory to allocate the object.") -(define-gl-procedure +(define-foreign-procedure ((gluNextContour (tess *) (type GLenum) -> void)) "Mark the beginning of another contour. @@ -1464,7 +1466,7 @@ This command is obsolete and is provided for backward compatibility only. Calls to `gluNextContour' are mapped to `gluTessEndContour' followed by `gluTessBeginContour'.") -(define-gl-procedure +(define-foreign-procedure ((gluNurbsCallbackDataEXT (nurb *) (userData *) @@ -1482,7 +1484,7 @@ USERDATA data to NURBS tessellator. A copy of this pointer will be passed by the tessellator in the NURBS callback functions (set by `gluNurbsCallback').") -(define-gl-procedure +(define-foreign-procedure ((gluNurbsCallbackData (nurb *) (userData *) @@ -1500,7 +1502,7 @@ USERDATA data to NURBS tessellator. A copy of this pointer will be passed by the tessellator in the NURBS callback functions (set by `gluNurbsCallback').") -(define-gl-procedure +(define-foreign-procedure ((gluNurbsCallback (nurb *) (which GLenum) @@ -1711,7 +1713,7 @@ The legal callbacks are as follows: void endData( void *userData );") -(define-gl-procedure +(define-foreign-procedure ((gluNurbsCurve (nurb *) (knotCount GLint) @@ -1773,7 +1775,7 @@ curve in two-dimensional homogeneous (U, V, and W) parameter space. See the `gluBeginTrim' reference page for more discussion about trimming curves.") -(define-gl-procedure +(define-foreign-procedure ((gluNurbsProperty (nurb *) (property GLenum) @@ -1915,7 +1917,7 @@ The accepted values for PROPERTY are as follows: from `GLU_TRUE' to `GLU_FALSE' does not affect the sampling and culling matrices until `gluLoadSamplingMatrices' is called.") -(define-gl-procedure +(define-foreign-procedure ((gluNurbsSurface (nurb *) (sKnotCount GLint) @@ -2002,7 +2004,7 @@ and TKNOTCOUNT knots in the V direction with orders SORDER and TORDER must have (SKNOTCOUNT - SORDER) TIMES (TKNOTCOUNT - TORDER) control points.") -(define-gl-procedure +(define-foreign-procedure ((gluOrtho2D (left GLdouble) (right GLdouble) @@ -2027,7 +2029,7 @@ BOTTOM `gluOrtho2D' sets up a two-dimensional orthographic viewing region. This is equivalent to calling `glOrtho' with NEAR=-1 and FAR=1 .") -(define-gl-procedure +(define-foreign-procedure ((gluPartialDisk (quad *) (inner GLdouble) @@ -2084,7 +2086,7 @@ coordinates are generated linearly such that where R=OUTER , the value at (R, 0, 0) is (1.0, 0.5), at (0, R, 0) it is (0.5, 1.0), at (\\-R, 0, 0) it is (0.0, 0.5), and at (0, \\-R, 0) it is (0.5, 0.0).") -(define-gl-procedure +(define-foreign-procedure ((gluPerspective (fovy GLdouble) (aspect GLdouble) @@ -2129,7 +2131,7 @@ F=COTANGENT\u2061(FOVY/2,) The generated matrix is ((F/ASPECT 0 0 0), (0 F 0 0), (0 0 ZFAR+ZNEAR,/ZNEAR-ZFAR, 2×ZFAR×ZNEAR,/ZNEAR-ZFAR,), (0 0 -1 0),)") -(define-gl-procedure +(define-foreign-procedure ((gluPickMatrix (x GLdouble) (y GLdouble) @@ -2175,7 +2177,7 @@ turned off, then any NURBS surface rendered is subdivided differently with the pick matrix than the way it was subdivided without the pick matrix.") -(define-gl-procedure +(define-foreign-procedure ((gluProject (objX GLdouble) (objY GLdouble) @@ -2235,7 +2237,7 @@ The window coordinates are then computed as follows: WINX=VIEW\u2061(0,)+VIEW\u2061(2,)×(V^″\u2061(0,)+1,)/2 WINY=VIEW\u2061(1,)+VIEW\u2061(3,)×(V^″\u2061(1,)+1,)/2 WINZ=(V^″\u2061(2,)+1,)/2") -(define-gl-procedure +(define-foreign-procedure ((gluPwlCurve (nurb *) (count GLint) @@ -2277,7 +2279,7 @@ then it describes a curve in two-dimensional homogeneous (U, V, and W) parameter space. See the `gluBeginTrim' reference page for more information about trimming curves.") -(define-gl-procedure +(define-foreign-procedure ((gluQuadricCallback (quad *) (which GLenum) @@ -2309,7 +2311,7 @@ The one legal callback is `GLU_ERROR': that occurred. Character strings describing these errors can be retrieved with the `gluErrorString' call.") -(define-gl-procedure +(define-foreign-procedure ((gluQuadricDrawStyle (quad *) (draw GLenum) @@ -2342,7 +2344,7 @@ with QUAD. The legal values are as follows: `GLU_POINT' Quadrics are rendered as a set of points.") -(define-gl-procedure +(define-foreign-procedure ((gluQuadricNormals (quad *) (normal GLenum) @@ -2370,7 +2372,7 @@ quadrics rendered with QUAD. The legal values are as follows: One normal is generated for every vertex of a quadric. This is the initial value.") -(define-gl-procedure +(define-foreign-procedure ((gluQuadricOrientation (quad *) (orientation GLenum) @@ -2398,7 +2400,7 @@ for quadrics rendered with QUAD. The ORIENTATION values are as follows: Note that the interpretation of OUTWARD and INWARD depends on the quadric being drawn.") -(define-gl-procedure +(define-foreign-procedure ((gluQuadricTexture (quad *) (texture GLboolean) @@ -2421,7 +2423,7 @@ they are not. The initial value is `GLU_FALSE'. The manner in which texture coordinates are generated depends upon the specific quadric rendered.") -(define-gl-procedure +(define-foreign-procedure ((gluScaleImage (format GLenum) (wIn GLsizei) @@ -2529,7 +2531,7 @@ is neither `GLU_RGBA' nor `GLU_BGRA'. `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.") -(define-gl-procedure +(define-foreign-procedure ((gluSphere (quad *) (radius GLdouble) @@ -2568,7 +2570,7 @@ at Z=RADIUS (T increases linearly along longitudinal lines), and S ranges from 0.0 at the +Y axis, to 0.25 at the +X axis, to 0.5 at the \\-Y axis, to 0.75 at the \\-X axis, and back to 1.0 at the +Y axis.") -(define-gl-procedure +(define-foreign-procedure ((gluTessBeginContour (tess *) -> void) (gluTessEndContour (tess *) -> void)) "Delimit a contour description. @@ -2584,7 +2586,7 @@ automatically linked to the first). See the `gluTessVertex' reference page for more details. `gluTessBeginContour' can only be called between `gluTessBeginPolygon' and `gluTessEndPolygon'.") -(define-gl-procedure +(define-foreign-procedure ((gluTessBeginPolygon (tess *) (data *) -> void)) "Delimit a polygon description. @@ -2613,7 +2615,7 @@ Once `gluTessEndPolygon' is called, the polygon is tessellated, and the resulting triangles are described through callbacks. See `gluTessCallback' for descriptions of the callback functions.") -(define-gl-procedure +(define-foreign-procedure ((gluTessCallback (tess *) (which GLenum) @@ -2834,7 +2836,7 @@ was called. The legal callbacks are as follows: void errorData( GLenum errno, void *polygon_data );") -(define-gl-procedure +(define-foreign-procedure ((gluTessEndPolygon (tess *) -> void)) "Delimit a polygon description. @@ -2855,7 +2857,7 @@ Once `gluTessEndPolygon' is called, the polygon is tessellated, and the resulting triangles are described through callbacks. See `gluTessCallback' for descriptions of the callback functions.") -(define-gl-procedure +(define-foreign-procedure ((gluTessNormal (tess *) (valueX GLdouble) @@ -2898,7 +2900,7 @@ input contours is nonnegative (where a CCW contour has positive area). The supplied normal persists until it is changed by another call to `gluTessNormal'.") -(define-gl-procedure +(define-foreign-procedure ((gluTessProperty (tess *) (which GLenum) @@ -2977,7 +2979,7 @@ interpreted and rendered. The legal values for WHICH are as follows: distinguish which side of the edge the vertex lies on. Two edges are merged only when both endpoints are identical.") -(define-gl-procedure +(define-foreign-procedure ((gluTessVertex (tess *) (location *) @@ -3008,7 +3010,7 @@ pointer is passed back to the user through the `GLU_TESS_VERTEX' or `GLU_TESS_VERTEX_DATA' callback after tessellation (see the `gluTessCallback' reference page).") -(define-gl-procedure +(define-foreign-procedure ((gluUnProject4 (winX GLdouble) (winY GLdouble) @@ -3083,7 +3085,7 @@ INV denotes matrix inversion. `gluUnProject4' is equivalent to `gluUnProject' when CLIPW is 1, NEARVAL is 0, and FARVAL is 1.") -(define-gl-procedure +(define-foreign-procedure ((gluUnProject (winX GLdouble) (winY GLdouble) diff --git a/figl/glu/types.scm b/figl/glu/types.scm new file mode 100644 index 0000000..5d0352f --- /dev/null +++ b/figl/glu/types.scm @@ -0,0 +1,27 @@ +;;; figl +;;; Copyright (C) 2013 Daniel Hartwig +;;; +;;; 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 program. If not, see +;;; . + +;;; Commentary: +;; +;; Mappings from OpenGL to FFI types. +;; +;;; Code: + +(define-module (figl glu types)) + +(module-use! (module-public-interface (current-module)) + (resolve-interface '(figl gl types))) diff --git a/figl/low-level/glx.scm b/figl/glx/low-level.scm similarity index 98% rename from figl/low-level/glx.scm rename to figl/glx/low-level.scm index 09982a4..e310c44 100644 --- a/figl/low-level/glx.scm +++ b/figl/glx/low-level.scm @@ -26,9 +26,11 @@ ;;; (define-module - (figl low-level glx) + (figl glx low-level) #:use-module - (figl low-level support) + (figl runtime) + #:use-module + (figl glx types) #:export (glXChooseFBConfig glXChooseVisual @@ -74,7 +76,7 @@ glXWaitGL glXWaitX)) -(define-gl-procedure +(define-foreign-procedure ((glXChooseFBConfig (dpy *) (screen int) @@ -419,7 +421,7 @@ lower numbered rule are sorted by the higher numbered rule): ATTRIB_LIST, if SCREEN is invalid, or if DPY does not support the GLX extension.") -(define-gl-procedure +(define-foreign-procedure ((glXChooseVisual (dpy *) (screen int) @@ -556,7 +558,7 @@ The interpretations of the various GLX visual attributes are as follows: `NULL' is returned if an undefined GLX attribute is encountered in ATTRIBLIST.") -(define-gl-procedure +(define-foreign-procedure ((glXCopyContext (dpy *) (src GLXContext) @@ -612,7 +614,7 @@ current drawable is a window that is no longer valid. `GLXBadContext' is generated if either SRC or DST is not a valid GLX context.") -(define-gl-procedure +(define-foreign-procedure ((glXCreateContext (dpy *) (vis *) @@ -683,7 +685,7 @@ not `NULL'. `BadAlloc' is generated if the server does not have enough resources to allocate the new context.") -(define-gl-procedure +(define-foreign-procedure ((glXCreateGLXPixmap (dpy *) (vis *) @@ -731,7 +733,7 @@ visual). `BadAlloc' is generated if the server cannot allocate the GLX pixmap.") -(define-gl-procedure +(define-foreign-procedure ((glXCreateNewContext (dpy *) (config GLXFBConfig) @@ -808,7 +810,7 @@ allocate the new context. `BadValue' is generated if CONFIG is not a valid visual (for example, if a particular GLX implementation does not support it).") -(define-gl-procedure +(define-foreign-procedure ((glXCreatePbuffer (dpy *) (config GLXFBConfig) @@ -876,7 +878,7 @@ the requested GLXPbuffer. `BadMatch' is generated if CONFIG does not support rendering to pixel buffers (e.g., `GLX_DRAWABLE_TYPE' does not contain `GLX_PBUFFER_BIT').") -(define-gl-procedure +(define-foreign-procedure ((glXCreatePixmap (dpy *) (config GLXFBConfig) @@ -919,7 +921,7 @@ window. `GLXBadFBConfig' is generated if CONFIG is not a valid GLXFBConfig.") -(define-gl-procedure +(define-foreign-procedure ((glXCreateWindow (dpy *) (config GLXFBConfig) @@ -966,7 +968,7 @@ window. `GLXBadFBConfig' is generated if CONFIG is not a valid GLXFBConfig.") -(define-gl-procedure +(define-foreign-procedure ((glXDestroyContext (dpy *) (ctx GLXContext) @@ -987,7 +989,7 @@ ID referenced by CTX is freed immediately. `GLXBadContext' is generated if CTX is not a valid GLX context.") -(define-gl-procedure +(define-foreign-procedure ((glXDestroyGLXPixmap (dpy *) (pix GLXPixmap) @@ -1008,7 +1010,7 @@ resource ID is freed immediately. `GLXBadPixmap' is generated if PIX is not a valid GLX pixmap.") -(define-gl-procedure +(define-foreign-procedure ((glXDestroyPbuffer (dpy *) (pbuf GLXPbuffer) @@ -1026,7 +1028,7 @@ PBUF `GLXBadPbuffer' is generated if PBUF is not a valid GLXPbuffer.") -(define-gl-procedure +(define-foreign-procedure ((glXDestroyPixmap (dpy *) (pixmap GLXPixmap) @@ -1044,7 +1046,7 @@ PIXMAP `GLXBadPixmap' is generated if PIXMAP is not a valid GLXPixmap.") -(define-gl-procedure +(define-foreign-procedure ((glXDestroyWindow (dpy *) (win GLXWindow) @@ -1062,7 +1064,7 @@ WIN `GLXBadWindow' is generated if WIN is not a valid GLXPixmap.") -(define-gl-procedure +(define-foreign-procedure ((glXFreeContextEXT (dpy *) (ctx GLXContext) @@ -1089,7 +1091,7 @@ supported. `GLXBadContext' is generated if CTX does not refer to a valid context.") -(define-gl-procedure +(define-foreign-procedure ((glXGetClientString (dpy *) (name int) -> *)) "Return a string describing the client. @@ -1118,7 +1120,7 @@ Both the major and minor portions of the version number are of arbitrary length. The vendor-specific information is optional. However, if it is present, the format and contents are implementation specific.") -(define-gl-procedure +(define-foreign-procedure ((glXGetConfig (dpy *) (vis *) @@ -1253,7 +1255,7 @@ a screen. `GLX_BAD_VISUAL' is returned if VIS doesn't support GLX and an attribute other than `GLX_USE_GL' is requested.") -(define-gl-procedure +(define-foreign-procedure ((glXGetContextIDEXT (ctx GLXContext) -> @@ -1276,7 +1278,7 @@ supported. `GLXBadContext' is generated if CTX does not refer to a valid context.") -(define-gl-procedure +(define-foreign-procedure ((glXGetCurrentContext -> GLXContext)) "Return the current context. @@ -1286,7 +1288,7 @@ supported. `glXGetCurrentContext' returns client-side information. It does not make a round trip to the server.") -(define-gl-procedure +(define-foreign-procedure ((glXGetCurrentDisplay -> *)) "Get display for current context. @@ -1297,7 +1299,7 @@ no context is current, `NULL' is returned. a round-trip to the server, and therefore does not flush any pending events.") -(define-gl-procedure +(define-foreign-procedure ((glXGetCurrentDrawable -> GLXDrawable)) "Return the current drawable. @@ -1307,7 +1309,7 @@ events.") `glXGetCurrentDrawable' returns client-side information. It does not make a round trip to the server.") -(define-gl-procedure +(define-foreign-procedure ((glXGetCurrentReadDrawable -> GLXDrawable)) "Return the current drawable. @@ -1318,7 +1320,7 @@ current drawable, `None' is returned. `glXGetCurrentReadDrawable' returns client-side information. It does not make a round-trip to the server.") -(define-gl-procedure +(define-foreign-procedure ((glXGetFBConfigAttrib (dpy *) (config GLXFBConfig) @@ -1567,7 +1569,7 @@ performance as well as poor resource allocation. extension. `GLX_BAD_ATTRIBUTE' is returned if ATTRIBUTE is not a valid GLX attribute.") -(define-gl-procedure +(define-foreign-procedure ((glXGetFBConfigs (dpy *) (screen int) @@ -1589,7 +1591,7 @@ NELEMENTS screen specified by SCREEN. Use `glXGetFBConfigAttrib' to obtain attribute values from a specific GLXFBConfig.") -(define-gl-procedure +(define-foreign-procedure ((glXGetProcAddress (procName *) -> @@ -1604,7 +1606,7 @@ PROCNAME PROCNAME. This is necessary in environments where the OpenGL link library exports a different set of functions than the runtime library.") -(define-gl-procedure +(define-foreign-procedure ((glXGetSelectedEvent (dpy *) (draw GLXDrawable) @@ -1628,7 +1630,7 @@ DRAW. `GLXBadDrawable' is generated if DRAW is not a valid window or a valid GLX pixel buffer.") -(define-gl-procedure +(define-foreign-procedure ((glXGetVisualFromFBConfig (dpy *) (config GLXFBConfig) @@ -1649,7 +1651,7 @@ returned. Returns `NULL' if CONFIG is not a valid GLXFBConfig.") -(define-gl-procedure +(define-foreign-procedure ((glXImportContextEXT (dpy *) (contextID GLXContextID) @@ -1692,7 +1694,7 @@ supported. `GLXBadContext' is generated if CONTEXTID does not refer to a valid context.") -(define-gl-procedure +(define-foreign-procedure ((glXIsDirect (dpy *) (ctx GLXContext) -> Bool)) "Indicate whether direct rendering is enabled. @@ -1710,7 +1712,7 @@ rendering commands to the X server. `GLXBadContext' is generated if CTX is not a valid GLX context.") -(define-gl-procedure +(define-foreign-procedure ((glXMakeContextCurrent (display *) (draw GLXDrawable) @@ -1800,7 +1802,7 @@ or GLXPbuffer. DRAW or READ is a GLXWindow or GLXPbuffer and CTX was previously bound to a GLXPixmap.") -(define-gl-procedure +(define-foreign-procedure ((glXMakeCurrent (dpy *) (drawable GLXDrawable) @@ -1870,7 +1872,7 @@ longer valid. ancillary buffers until `glXMakeCurrent' is called, only to find that it has insufficient resources to complete the allocation.") -(define-gl-procedure +(define-foreign-procedure ((glXQueryContextInfoEXT (dpy *) (ctx GLXContext) @@ -1925,7 +1927,7 @@ attribute. fred `GLX_BAD_CONTEXT' is returned if ATTRIBUTE is not a valid context.") -(define-gl-procedure +(define-foreign-procedure ((glXQueryContext (dpy *) (ctx GLXContext) @@ -1967,7 +1969,7 @@ This call may cause a round-trip to the server. `GLXBadContext' is generated if CTX does not refer to a valid context.") -(define-gl-procedure +(define-foreign-procedure ((glXQueryDrawable (dpy *) (draw GLXDrawable) @@ -2025,7 +2027,7 @@ above, the contents of VALUE are unedfined. A `GLXBadDrawable' is generated if DRAW is not a valid GLXDrawable.") -(define-gl-procedure +(define-foreign-procedure ((glXQueryExtensionsString (dpy *) (screen int) @@ -2045,7 +2047,7 @@ null-terminated and contains a space-separated list of extension names. (The extension names themselves never contain spaces.) If there are no extensions to GLX, then the empty string is returned.") -(define-gl-procedure +(define-foreign-procedure ((glXQueryExtension (dpy *) (errorBase *) @@ -2073,7 +2075,7 @@ ERRORBASE and EVENTBASE are unchanged. ERRORBASE and EVENTBASE do not return values if they are specified as `NULL'.") -(define-gl-procedure +(define-foreign-procedure ((glXQueryServerString (dpy *) (screen int) @@ -2098,7 +2100,7 @@ possible values for NAME and the format of the strings is the same as for `glXGetClientString'. If NAME is not set to a recognized value, `NULL' is returned.") -(define-gl-procedure +(define-foreign-procedure ((glXQueryVersion (dpy *) (major *) @@ -2128,7 +2130,7 @@ MAJOR and MINOR do not return values if they are specified as `NULL'. MAJOR and MINOR are not updated when `False' is returned.") -(define-gl-procedure +(define-foreign-procedure ((glXSelectEvent (dpy *) (draw GLXDrawable) @@ -2260,7 +2262,7 @@ portions of those buffers\\(emwere affected. `GLXBadDrawable' is generated if DRAW is not a valid window or a valid GLX pixel buffer.") -(define-gl-procedure +(define-foreign-procedure ((glXSwapBuffers (dpy *) (drawable GLXDrawable) @@ -2295,7 +2297,7 @@ the display and drawable associated with the current context of the calling thread, and DRAWABLE identifies a window that is no longer valid.") -(define-gl-procedure +(define-foreign-procedure ((glXUseXFont (font Font) (first int) @@ -2345,7 +2347,7 @@ display-list construction mode. current context of the calling thread is a window, and that window is no longer valid.") -(define-gl-procedure +(define-foreign-procedure ((glXWaitGL -> void)) "Complete GL execution prior to subsequent X calls. @@ -2361,7 +2363,7 @@ in cases where client and server are on separate machines. current context of the calling thread is a window, and that window is no longer valid.") -(define-gl-procedure +(define-foreign-procedure ((glXWaitX -> void)) "Complete X execution prior to subsequent GL calls. diff --git a/figl/glx/types.scm b/figl/glx/types.scm new file mode 100644 index 0000000..249b7db --- /dev/null +++ b/figl/glx/types.scm @@ -0,0 +1,27 @@ +;;; figl +;;; Copyright (C) 2013 Daniel Hartwig +;;; +;;; 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 program. If not, see +;;; . + +;;; Commentary: +;; +;; Mappings from OpenGL to FFI types. +;; +;;; Code: + +(define-module (figl glx types)) + +(module-use! (module-public-interface (current-module)) + (resolve-interface '(figl gl types))) diff --git a/figl/low-level/support.scm b/figl/runtime.scm similarity index 78% rename from figl/low-level/support.scm rename to figl/runtime.scm index 347679a..32f34c2 100644 --- a/figl/low-level/support.scm +++ b/figl/runtime.scm @@ -21,25 +21,19 @@ ;; ;;; Code: -(define-module (figl low-level support) +(define-module (figl runtime) #:use-module (system foreign) - #:export (current-gl-resolver - define-gl-procedure - void)) + #:export (current-resolver + define-foreign-procedure)) -(define void #f) - -(module-use! (module-public-interface (current-module)) - (resolve-interface '(figl low-level types))) - -(define (default-foreign-resolver name) +(define (default-resolver name) (dynamic-pointer name (dynamic-link))) -(define current-gl-resolver - (make-parameter default-foreign-resolver)) +(define current-resolver + (make-parameter default-resolver)) -(define (resolve-foreign name) - ((current-gl-resolver) name)) +(define (resolve name) + ((current-resolver) name)) (define-syntax foreign-trampoline (lambda (stx) @@ -48,14 +42,14 @@ name (pname ptype) ... -> type) (with-syntax ((sname (symbol->string (syntax->datum #'name)))) #'(lambda (pname ...) - (let ((ptr (resolve-foreign sname))) + (let ((ptr (resolve sname))) (set! trampoline (pointer->procedure type ptr (list ptype ...))) (trampoline pname ...)))))))) -(define-syntax define-gl-procedure +(define-syntax define-foreign-procedure (syntax-rules (->) ((define-gl-procedure ((name (pname ptype) ... -> type) ...) diff --git a/maint/update-low-level-bindings b/maint/update-low-level-bindings index a023ec5..bd3872f 100755 --- a/maint/update-low-level-bindings +++ b/maint/update-low-level-bindings @@ -21,16 +21,16 @@ (loop (cdr l) (cons (car l) (cons elem dest))))))) (define (module-name->scm-name mod-name) - (in-vicinity - (abs-top-srcdir) - (string-append (string-join (map symbol->string mod-name) "/") - ".scm"))) + (string-join (list (abs-top-srcdir) + "figl" + (symbol->string mod-name) + "low-level.scm") + "/")) (define (module-name->texi-name mod-name) (in-vicinity (in-vicinity (abs-top-srcdir) "doc") - (string-append (string-join (map symbol->string (cdr mod-name)) "-") - ".texi"))) + (string-append "low-level-" (symbol->string mod-name) ".texi"))) (define (unique-copyrights defs) (let lp ((in defs) (out '())) @@ -83,8 +83,9 @@ " port) (newline port) (pretty-print - `(define-module ,mod-name - #:use-module (figl low-level support) + `(define-module (figl ,mod-name low-level) + #:use-module (figl runtime) + #:use-module (figl ,mod-name types) #:export ,(append-map (lambda (def) (map car (gl-definition-prototypes def))) defs)) @@ -93,7 +94,7 @@ (for-each (lambda (def) (pretty-print - `(define-gl-procedure ,(gl-definition-prototypes def) + `(define-foreign-procedure ,(gl-definition-prototypes def) ,(string-trim-both (stexi->plain-text (gl-definition-documentation def)))) @@ -107,7 +108,7 @@ `(*fragment* (para "The functions from this section may be had by loading " "the module:") - (example "(use-modules " ,(object->string mod-name) ")") + (example "(use-modules (figl " ,(object->string mod-name) " low-level)") (copying (para "This section of the manual was derived from the upstream " @@ -166,9 +167,9 @@ (call-with-values (lambda () (partition-definitions version)) (lambda (gl glu glx) - (write-bindings '(figl low-level gl) (reverse gl)) - (write-bindings '(figl low-level glu) (reverse glu)) - (write-bindings '(figl low-level glx) (reverse glx))))) + (write-bindings 'gl (reverse gl)) + (write-bindings 'glu (reverse glu)) + (write-bindings 'glx (reverse glx))))) (when (batch-mode?) (apply main (command-line))) -- 2.20.1