standard buffer library

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

standard buffer library

Steve Dekorte-4

Since we're talking about standard libs, I just wanted to mention that a standard buffer lib would be a big help for lua add-on developers. Right now, each new add-on C library that requires buffers(many do) implements it's own buffer library.

Steve



Reply | Threaded
Open this post in threaded view
|

Re: standard buffer library

Luiz Henrique de Figueiredo
>Since we're talking about standard libs, I just wanted to mention that a 
>standard buffer lib would be a big help for lua add-on developers. Right 
>now, each new add-on C library that requires buffers(many do) implements 
>it's own buffer library.

The auxlib contains buffer functions.
--lhf

Reply | Threaded
Open this post in threaded view
|

Re: standard buffer library

Steve Dekorte-4

On Thursday, January 31, 2002, at 03:53 AM, Luiz Henrique de Figueiredo wrote:
Since we're talking about standard libs, I just wanted to mention that a standard buffer lib would be a big help for lua add-on developers. Right now, each new add-on C library that requires buffers(many do) implements
it's own buffer library.

The auxlib contains buffer functions.

Cool, I'll take a look. Is this new?
I wonder why Waldemar didn't use it for glLua?

Steve



Reply | Threaded
Open this post in threaded view
|

Re: standard buffer library

Luiz Henrique de Figueiredo
In reply to this post by Steve Dekorte-4
>> The auxlib contains buffer functions.
>
>Cool, I'll take a look. Is this new?

Not at all, unless I misunderstand what you mean by buffer.
See "Generic Buffer manipulation" in lauxlib.h .
--lhf

Reply | Threaded
Open this post in threaded view
|

Re: standard buffer library

Waldemar Celes
In reply to this post by Steve Dekorte-4
At 04:17 31/1/2002 -0800, you wrote:

On Thursday, January 31, 2002, at 03:53 AM, Luiz Henrique de Figueiredo wrote:
Since we're talking about standard libs, I just wanted to mention that a
standard buffer lib would be a big help for lua add-on developers. Right
now, each new add-on C library that requires buffers(many do) implements
it's own buffer library.

The auxlib contains buffer functions.

Cool, I'll take a look. Is this new?
I wonder why Waldemar didn't use it for glLua?

both tolua and gllua are older than auxlib.
regarding gllua for lua 4.0, I inclined to implement the
buffers using regular Lua strings.

-- waldemar


Reply | Threaded
Open this post in threaded view
|

Re: standard buffer library

Jim Mathies-2
The main reason we did not use strings for buffers
was the lack of support for changing a string's contents
without recreating the string in memory. For example
bit operations on a particular byte or set of bytes in a 
texture.

I think strings work fine though as a 'base implementation'
of the GL interface for Lua.

Regards,
Jim

| 
| both tolua and gllua are older than auxlib.
| regarding gllua for lua 4.0, I inclined to implement the
| buffers using regular Lua strings.
| 
| -- waldemar
| 
| 
| 


Reply | Threaded
Open this post in threaded view
|

Re: standard buffer library

Luiz Henrique de Figueiredo
In reply to this post by Steve Dekorte-4
>The main reason we did not use strings for buffers
>was the lack of support for changing a string's contents
>without recreating the string in memory.

You can use lua_newuserdata, which allocates a buffer and hands it back to you.
It's fully writable.
--lhf