Re: EuGL alpha 1 release

new topic     » goto parent     » topic index » view thread      » older message » newer message

> <heresy>
>  Wouldn't it be nice if, when Rob implements namespaces, he could
>  somehow allow _direct_ calls to C routines, so we could do away with
>  all that c_func() and c_proc() stuff.
> </heresy>
> It's not that I like c, but it looks like using c calls is going to be
> unavoidable
> if we intend to use any graphics or windowing library.
>
> Regards,
> Irv

I've actually thought of a nice way for library builders to make libraries
more user friendly.  (Not sure how original this is, but I have never seen
it doen, it seems quite obvious to me).

Say you have a mydll.dll with a c_func in it called mycfunc that takes two
parameters of C_INT and returns a C_INT.

mydll = open_dll("mydll.dll")
cfunc1 = define_c_func(mydll, "mycfunc", {C_INT, C_INT}, C_INT}
global function mycfunc(integer first, integer second)
    return c_func(cfunc1 , {first, second})
end function

We can now call mycfunc as if it was just a regular function.  No more user
playing around with c_func and c_proc.  Just an idea.

Adam Weeden

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu