Alexander Burger <abu@...> writes:

> 
> 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
> 

Hi Alex, thanks for your answer its like you wrote and it does allocate
normally now!
I  have another question, before I also tried to use the glutBitmapCharacter
function in which one passes a void* with the font, so I did like in the
opengl.l file and added a def with the font hex as listed in freeglut_std.h
but when called it says that the font wasn't found.
Maybe this is a problem in what am feeding to the function, 
do void* have to be specified different?
The glutBitmapCharacter used I read was on china-gl.l by Jon Kleiser, 
but that was for the 32bit version of pico and it used glue code
to specify the void pointer.

-Oscar.


Reply via email to