Hi Oscar,

> (de glGenTextures (_tex-num _tex-ptr)
>     (native `*GlutLib "glGenTextures" _tex-num (list _tex-ptr (4 . I)) )

Probably it is just a copy/paste error, but you are sure that the above
expression has one more closing parenthesis, right? Because otherwise
the code following this might also be part your definition.


> It should store a pointer in _tex-ptr but when run it gives the error
> *** Error in "/usr/bin/picolisp": free(): invalid next size (fast)

I haven't tried myself, but "GL/gl.h" says

   GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures );

So 'textures' is an array of pointers. Is 'n' the size of that array?
Then I would think the expression (list _tex-ptr (4 . I)) should be

   (list _tex-ptr (cons (* _tex-num 8) 'N _tex-num))


For example, if '_tex-num' is 4 and '_tex-ptr' is 'A', then this will
evaluate to

   (A (32 N . 4))

meaning 'A' is the symbol to receive the pointer, 32 the total size of
the structure, and (N . 4) an array of 4 pointers.

You would call it as

   (glGenTextures 4 'A)

Did I forget something?

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to