You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello Fujita
I've been trying to use ypsilon for GLSL shader implementation, but I'm having
a little trouble with some of the GL calls. It may be that I've missed
something, of course.
My issue is this: glShaderSource as follows:
;; void glShaderSource(GLuint shader, GLsizei count, const GLchar ** string,
const GLint * length);
(define-function void glShaderSource (int int void* void*))
and, having successfully created a shader object, try to attach my source to
it. The problem is that glShaderSource wants an array of c strings as its
third parameter, and I can't seem to make one. What I really want to do is
something like this:
(let* ([shader-source (make-c-string source-string)]
[shader-source-ptr (make-c-void* shader-source)]
[shader-length (bytevector-length shader-source)]
[shader-lengths (make-c-int 1)])
(glShaderSource my-shader 1 shader-source-ptr shader-lengths)
Or, even better, given that I don't need my strings to be null-terminated
(let* ([shader-source (make-bytevector-mapping source-string)]
[shader-source-ptr (make-c-void* shader-source)]
[shader-length (string-length source-string)]
[shader-lengths (make-c-int shader-length)])
(glShaderSource my-shader 1 shader-source-ptr shader-lengths)
The problem, in both cases, is the second assignment in the let*, or "how do I
put the address of one bytevector or bytevector mapping into another bytevector
or bytevector mapping". I can't see a way of doing this with the current API.
Regards
Simon
Original issue reported on code.google.com by simon.st...@gmail.com on 29 May 2013 at 6:38
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
simon.st...@gmail.com
on 29 May 2013 at 6:38The text was updated successfully, but these errors were encountered: