[squeak-dev] Need your opinion: What is most appealing form for GL function bindings?

Frank Shearar frank.shearar at angband.za.org
Fri May 21 08:57:42 UTC 2010


On 2010/05/20 18:23, Igor Stasenko wrote:
> Just few more examples.
>
> For functions, which taking small number of arguments, and which you
> using most frequently,
> #with: is not playing a significant role..
>
> But consider a following function:
>
> void glAlphaFragmentOp2ATI ( GLenum op , GLuint dst , GLuint dstMod ,
> GLuint arg1 , GLuint arg1Rep , GLuint arg1Mod , GLuint arg2 , GLuint
> arg2Rep , GLuint arg2Mod )
>
> Currently it translated as:
>
> gl
>     glAlphaFragmentOp2ATI: op
>     dst: dst
>     dstMod: dstMod
>     arg1: arg1
>     arg1Rep:arg1Rep
>     arg1Mod: arg1Mod
>     arg2: arg2
>     arg2Rep: arg2Rep
>     arg2Mod: arg2Mod

That convinces me that #with:#with: is the less useful form. Igor, I 
reckon your example above's the way to go.

(I prefer the above to "gl alphaFragmentOp2ATI ...." (missing gl prefix) 
because you're explicitly talking to OpenGL, and I reckon it makes 
things easier to follow when both sides use the same names for things. 
You can see from the above that you need to look for the 
glAlphaFragmentOp2ATI(...) function and yes, a human can just mentally 
add the prefix, but dumped out to a file you could grep both the 
Smalltalk and C code and find all the calls to that function.)

frank



More information about the Squeak-dev mailing list