Igor one last thing I forgot to ask about b) how I pass the pointer to the function ?
Now Camillo , If you guys care about making pharo popular , I mean really popular you should stop caring what you want or what I want and care more about what most people want. Democracy sucks but hey thats the way to fame. I am sorry but I am not buying into the whole argument of self documented code. Why ? Because I dont trust coders. I know however for a fact that as you said it "outside" documentation , assuming its a lengthy one, even if its a bad one, is a much safer bet to make sense , especially for a very big library. If the library is very small sure you can deal with it with class comments and method comments and some random examples. But take Nativeboost for example, understanding Nativeboost without outside documentation is just , well crazy. There so many issues to discuss and many concepts to analyse, and if we take into account that people dealing with Nativeboost are not C coders or experienced with C coding then you will have loads of user with a big questionmark on top of their heads. Sure those people should go read a C code, which I do already , but still would I complain if documentation of NB explained those things to me ? Why would I , I am as lazy as the next person. Plus I am a user why should I care about class comments and methods comments, I dont care how the source works I only care how I can use the library the easiest , quickest way possible. Should classes and methods have their comments ? definitely !!! This is open source , its meant to be read , analyzed and modified. Making people life harder is making it more close source. But I dont believe a user of a library would prioritize class / method comments and code example over old-way hardcore documentation. I seriously believe pharo would greatly benefit from a wiki and would help taking it more seriously. Or at least an included documentation tool inside pharo that will make documentation much easier. I mentioned wikibooks because its based on already highly successful popular technology. If you have better recommendation I am open to any ideas. So in short yes I will comment class/methods of Nativeboost and yes I will contribute to wikibooks as well. Camillo Bruni-3 wrote > I like to see people contributing :), maybe you could do some contribution > on the code-side? > > I personally consider well written, executable examples more valuable than > written documentation outside the image. And I think NativeBoost could > benefit from some in-image documentation. > > > On 2013-07-02, at 14:39, kilon < > [email protected] > > wrote: >> And I love pharo and what you guys have created , a lot of fun and very >> productive. So yes I will definitely help you out in documenting NB. >> >> Actually my idea was not to publish in a blog. I hate blogs though I have >> one I just find it very non flexible so I was thinking instead wikibooks >> . >> >> http://en.wikibooks.org/wiki/Help:Contributing >> <http://en.wikibooks.org/wiki/Help:Contributing> >> >> I was thinking moving the entire nativeboost docs (pdf/latex) to wiki >> books >> so I make it much easier for everyone can contribute. Wikibooks uses >> Mediawiki which I am familiar with from the blender wiki when I was >> making >> my python book >> >> http://wiki.blender.org/index.php/User:Kilon/Python_book_of_magic >> <http://wiki.blender.org/index.php/User:Kilon/Python_book_of_magic> >> >> Mediawiki is nowhere near as powerful as latex but its way easier to >> learn >> and it literally takes minutes to learn the syntax and you dont need a >> special editor you can do it online directly with minimum syntax. This >> way >> everyone can contribute , it only needs an account. >> >> >> >> Stéphane Ducasse wrote >>> I love your questions! >>> When you will get all your anwsers you have to write a blog about it so >>> that we can use that in >>> a chapter so that every body can know how to do it. >>> >>> Just no time to think right now :( sadly >>> >>> Stef >>> >>> On Jul 1, 2013, at 8:40 PM, kilon < >> >>> [email protected] >> >>> > wrote: >>> >>>> Thanks Igor , yes I was aware of String Cr because I have done some >>>> googling >>>> around and it did find information on the subject. Apparently it failed >>>> because I had an error in my source. >>>> >>>> So for our next challenge is learning how to fetch data that a pointer >>>> points to. >>>> >>>> in this case I have an array that contains my vertex positions , called >>>> vertexPositions >>>> >>>> vertexPositions >>>> "the positions of vertices to be passed to opengl" >>>> >>>> ^ #( 0.75 0.75 0.0 1.0 >>>> 0.75 -0.75 0.0 1.0 >>>> -0.75 -0.75 0.0 1.0 ) >>>> >>>> so far so good >>>> >>>> so I create a pointer for that array >>>> >>>> vptrsize := (NBExternalType sizeOf: 'float')* self vertexPositions >>>> size. >>>> >>>> and then take that pointer and insert in each position the individual >>>> values >>>> from vertexPositions >>>> >>>> vertexPositions withIndexDo: [:each :i | >>>> "using nbUInt32AtOffset because we know pointer is 4 bytes :) " >>>> vpos nbFloat32AtOffset: (i-1)*(NBExternalType sizeOf: 'float') >>>> put: >>>> each value. >>>> Transcript show: ' I am putting to vpos in index: '; show: i-1; show:' >>>> value: '; show: each value; cr. >>>> ]. >>>> >>>> so far so good. >>>> >>>> now the tricky part is that I have a function that expects that Array , >>>> not >>>> the smalltalk version but the C version we just created >>>> >>>> gl bufferData_target: GL_ARRAY_BUFFER size: vptrsize data: ....... >>>> usage: >>>> GL_STATIC_DRAW. >>>> >>>> where you see the dots is where I should pass the data, in this case >>>> the >>>> C >>>> array >>>> >>>> I could do a vpo nbFloat32AtOffset: but that will return me only the >>>> individual value at the specific point (index) of the array, while I >>>> want >>>> to >>>> pass the entire array. >>>> >>>> So how I do that ? >>>> >>>> I explored NBExternalAdress and I cant find something that would return >>>> an >>>> array. Am I missing something obvious here ? >>>> >>>> NBExternalAdress value , returns the number of the address and not that >>>> data >>>> contained in that address. >>>> >>>> I also see a NBExternalArray but I am not sure if it is what I should >>>> be >>>> using . >>>> >>>> Igor Stasenko wrote >>>>> On 30 June 2013 21:11, kilon < >>>> >>>>> [email protected] >>>> >>>>> > wrote: >>>>>> I am not going to post my code here cause it has become too big , you >>>>>> can >>>>>> find it here >>>>>> >>>>>> http://www.smalltalkhub.com/#!/~kilon/GLTutorial >>>>>> <http://www.smalltalkhub.com/#!/~kilon/GLTutorial> >>>>>> >>>>>> I tried adding newlines with String cr to my shaders strings, but >>>>>> apparently >>>>>> opengl is not convinced. It looks like smalltalk cr is not converted >>>>>> to >>>>>> C >>>>>> "\n" newlines. So how I do that ? >>>>>> >>>>> >>>>> simply replace all occurences of >>>>> Character cr >>>>> with >>>>> Character lf >>>>> (or crlf, if it wants that) >>>>> >>>>>> -- >>>>>> View this message in context: >>>>>> http://forum.world.st/Understanding-NBOpenGL-tp4686514p4696465.html >>>>>> Sent from the Pharo Smalltalk Developers mailing list archive at >>>>>> Nabble.com. >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Best regards, >>>>> Igor Stasenko. >>>> >>>> >>>> >>>> >>>> >>>> -- >>>> View this message in context: >>>> http://forum.world.st/Understanding-NBOpenGL-tp4686514p4696666.html >>>> Sent from the Pharo Smalltalk Developers mailing list archive at >>>> Nabble.com. >>>> >> >> >> >> >> >> -- >> View this message in context: >> http://forum.world.st/Understanding-NBOpenGL-tp4686514p4696807.html >> Sent from the Pharo Smalltalk Developers mailing list archive at >> Nabble.com. >> -- View this message in context: http://forum.world.st/Understanding-NBOpenGL-tp4686514p4696870.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
