Re: OpenGL text and Picolisp

2015-07-19 Thread Oscar
Alexander Burger abu@... writes:

 BTW, Jon + Oscar:
 
 I've lost overview a little bit. But it seems that both of you added
 some useful functions to  at lib/openGl.l
 
 Perhaps it makes sense if we add them to the PicoLisp release? If so,
 can one of you send me all relevant additions?
 
 ♪♫ Alex
 

Sure thing, but am still not finished testing, still cant get textures
working right.

-OscarPԔ � j)mX�����zV�u�.n7�

Re: OpenGL text and Picolisp

2015-07-16 Thread Jon Kleiser
Hi Alex,

My work on OpenGL for 64-bit PicoLisp ended around 28-Dec-2011, when I sent you 
this email (not to the list):

 I am quite close to having my Chinese Checkers game ready for 64-bit. The 
 functions that I have not cracked yet, are glutBitmapCharacter and 
 glutStrokeCharacter. It is the Font parameter that is the problem. In the 
 attached alpha version of china-gl.l I do a prinl in my drawBitString, 
 instead of calling glutBitmapCharacter. My current openGl.l is also included 
 in the attached china64.tgz. Do you think you can fix the font handling in 
 those two glut functions? (I typically get freeglut stroke font 0x... not 
 found.)
 


You may have the china64.tgz that I mention, but if you need it, I can send it.

/Jon

On 14. Jul, 2015, at 18:05, Alexander Burger a...@software-lab.de wrote:

 Hi Oscar,
 
 On Tue, Jul 14, 2015 at 03:41:39PM +, Oscar wrote:
 Hi Alex, thanks for your answer its like you wrote and it does allocate
 normally now!
 
 Glad to hear!
 
 
 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?
 
 No, void* should also be just a number. The 'native' function doesn't
 care anyway to what kind of data a pointer points.
 
 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.
 
 In Jon's china64/openGl.l I find
 
   (de glutBitmapCharacter (Font Character)
  (native `*GlutLib glutBitmapCharacter NIL Font Character) )
 
 
 BTW, Jon + Oscar:
 
 I've lost overview a little bit. But it seems that both of you added
 some useful functions to @lib/openGl.l
 
 Perhaps it makes sense if we add them to the PicoLisp release? If so,
 can one of you send me all relevant additions?
 
 ♪♫ Alex

PԔ � j)mX�����zV�u�.n7�

Re: OpenGL text and Picolisp

2015-07-14 Thread Alexander Burger
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


Re: OpenGL text and Picolisp

2015-07-14 Thread Oscar
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.




Re: OpenGL text and Picolisp

2015-07-14 Thread Alexander Burger
Hi Oscar,

On Tue, Jul 14, 2015 at 03:41:39PM +, Oscar wrote:
 Hi Alex, thanks for your answer its like you wrote and it does allocate
 normally now!

Glad to hear!


 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?

No, void* should also be just a number. The 'native' function doesn't
care anyway to what kind of data a pointer points.

 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.

In Jon's china64/openGl.l I find

   (de glutBitmapCharacter (Font Character)
  (native `*GlutLib glutBitmapCharacter NIL Font Character) )


BTW, Jon + Oscar:

I've lost overview a little bit. But it seems that both of you added
some useful functions to @lib/openGl.l

Perhaps it makes sense if we add them to the PicoLisp release? If so,
can one of you send me all relevant additions?

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


Re: OpenGL text and Picolisp

2015-07-14 Thread Alexander Burger
Minor correction:

On Tue, Jul 14, 2015 at 08:02:23AM +0200, Alexander Burger wrote:
 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

Should be:

   meaning 'A' is the symbol to receive the list of four pointers (numbers).


 You would call it as
 
(glGenTextures 4 'A)

BTW, don't forget to bind the symbol 'A', e.g.:

   (use A
  (glGenTextures 4 'A)
  .. )

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


OpenGL text and Picolisp

2015-07-13 Thread Oscar

Hi, I've been writing a small opengl program using freeglut and the native 
C calls, however I run into problems when trying to read a texture in order
to display text, specifically when calling glGenTextures expanded from 
the openGl.l in lib.

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

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)

Anyone has any experience working with opengl 
displaying text or had this error?
I'm really clueless about how should one go about this in Pico.

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