[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] guile-figl - Add wrappers for common texture functions.
From: |
Daniel Hartwig |
Subject: |
Re: [PATCH] guile-figl - Add wrappers for common texture functions. |
Date: |
Sat, 20 Jul 2013 00:38:08 +0800 |
On 13 June 2013 09:14, David Thompson <address@hidden> wrote:
> Filled in some holes regarding OpenGL texture functions. There are 2
> left as TODO that I'm not quite sure how to handle nicely.
>
Hello
Thanks also for this patch, though I am not applying it at the moment.
I have inserted some comments inline, and also have opened up another
block of time where I can do more work on this soon.
Note that you can (temporarily) define any missing interfaces in your
local project and avoid asking your users to run a patched figl.
Having looked at this patch, it seems you probably want to just access
the low-level bindings in (figl gl low-level) module directly, and
third party libraries are encouraged to do so.
Anyway, thanks again for the efforts and hope to get more high-level
interfaces shortly.
> ---
> figl/gl.scm | 76
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
> 1 file changed, 72 insertions(+), 4 deletions(-)
>
> diff --git a/figl/gl.scm b/figl/gl.scm
> index edbd7c8..4924be1 100644
> --- a/figl/gl.scm
> +++ b/figl/gl.scm
> @@ -293,7 +293,75 @@
>
> (re-export (%glShadeModel . set-gl-shade-model))
>
> -
> +;;;
> +;;; 3.8.1 Texture Image Specification
> +;;;
> +
> +(re-export (%glTexImage3D . gl-texture-image-3d)
> + (%glTexImage2D . gl-texture-image-2d)
> + (%glTexImage1D . gl-texture-image-1d))
> +
For the high level interface, we really like to have some sanity
checks on the supplied data. The same applies to most of the other
re-exports.
Third party libraries are encouraged to directly access these
low-level bindings as appropriate, they are in the (figl gl low-level)
module.
> +;;;
> +;;; 3.8.4 Texture Parameters
> +;;;
> +
> +(re-export (%glTexParameteri . gl-texture-parameter))
> +
What about float parameters, and vectors?
> +;; emacs: (put 'with-gl-bind-texture 'scheme-indent-function 2)
> +(define-syntax-rule (with-gl-bind-texture target id body ...)
> + (begin
> + (%glBindTexture target id)
> + body
> + ...
> + (%glBindTexture target 0)))
> +
With this style it should revert to the previous texture bound to
TARGET, which can be queried and may not be ‘0’.
Regards
- Re: [PATCH] guile-figl - Add wrappers for common texture functions.,
Daniel Hartwig <=