Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-07-04 Thread Igor Stasenko
On 3 July 2013 22:36, Guillermo Polito guillermopol...@gmail.com wrote: I'm just guessing, but if a function receives a pointer, it does not store the pointer anywhere but works with the contents, and finally returns while VM is blocked, voilá :). Yes. On Wed, Jul 3, 2013 at 10:13 PM,

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-07-04 Thread Stéphane Ducasse
ok we should write that in the NB chapter. On Jul 3, 2013, at 10:36 PM, Guillermo Polito guillermopol...@gmail.com wrote: I'm just guessing, but if a function receives a pointer, it does not store the pointer anywhere but works with the contents, and finally returns while VM is blocked,

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-07-03 Thread Igor Stasenko
On 2 July 2013 23:04, kilon theki...@yahoo.co.uk wrote: Thank you Igor for the clarifications, the reason why I prefer using the nativeboost methods is because : a) I was not sure if smalltalk types map correctly to C types and which Smalltalk types correspond to which C types well, there's

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-07-03 Thread Stéphane Ducasse
if you pass a pointer to something in object memory into function, make sure GC cannot move the object while function uses/accessing its contents. How?

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-07-02 Thread kilon
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 .

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-07-02 Thread Camillo Bruni
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

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-07-02 Thread kilon
Igor got you will try to avoid using #sizeOf: , even for a readability I can replace it with a simple method returning the same thing depending in platform. Now because I am confused lets clarify how the whole things works because I see many errors in my code and clearly I don't understand how

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-07-02 Thread kilon
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

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-07-02 Thread Igor Stasenko
On 2 July 2013 16:27, kilon theki...@yahoo.co.uk wrote: Igor got you will try to avoid using #sizeOf: , even for a readability I can replace it with a simple method returning the same thing depending in platform. Now because I am confused lets clarify how the whole things works because I see

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-07-02 Thread kilon
Thank you Igor for the clarifications, the reason why I prefer using the nativeboost methods is because : a) I was not sure if smalltalk types map correctly to C types and which Smalltalk types correspond to which C types b) many opengl functions ask for the address of the value and the value

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-07-01 Thread Igor Stasenko
On 30 June 2013 21:11, kilon theki...@yahoo.co.uk 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

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-07-01 Thread kilon
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

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-07-01 Thread kilon
Sorry I forgot to paste how i create the vpos pointer vpos := NativeBoost allocate: vptrsize. My questions on how to pass the contents of a C array to a C function as can be seen in quoted message remains :) kilon wrote Thanks Igor , yes I was aware of String Cr because I have done some

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-07-01 Thread Stéphane Ducasse
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 theki...@yahoo.co.uk wrote: Thanks Igor

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-07-01 Thread Igor Stasenko
On 1 July 2013 20:40, kilon theki...@yahoo.co.uk 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

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-06-30 Thread kilon
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

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-06-28 Thread Igor Stasenko
On 28 June 2013 13:11, kilon theki...@yahoo.co.uk wrote: found a bug in NBOpengl this function definition is incorrect getShaderiv_shader: in shader pname: in pname params: out params primitive: #primitiveNativeCall module: #NativeBoostPlugin error: primErrorCode ^ self

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-06-27 Thread kilon
I also tried gl shaderSource_shader: shader count: 1 string: (NBExternalAddress fromString: shaderString) length: (NBExternalObject null) . still getting Error during FFI call : NIL . This is the full method : createShader: shaderType string: shaderString create shader using its

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-06-27 Thread Henrik Johansen
On Jun 27, 2013, at 2:22 , Igor Stasenko wrote: i think it fails because you passing strange (NBExternalObject null) as length parameter. i guess you meant NBExternalAddress null instead. Speaking of weird external stuff… NBExternalArray class #initElementType: aTypeName

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-06-27 Thread Stéphane Ducasse
Igor we should document such mistakes This is important can you add such comments in class comment? On Jun 27, 2013, at 5:26 PM, Igor Stasenko siguc...@gmail.com wrote: On 27 June 2013 17:14, Henrik Johansen henrik.s.johan...@veloxit.no wrote: On Jun 27, 2013, at 4:11 , Igor Stasenko wrote:

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-06-27 Thread Igor Stasenko
On 27 June 2013 18:32, Stéphane Ducasse stephane.duca...@inria.fr wrote: On Jun 2 Yes, you right. (NBFFICallout new resolveType: 'byte*') valueSize = 1 (NBFFICallout new resolveType: 'byte*') storageSize = 4 apparently, if one wants array with 'byte*' element type (or any other) it

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-06-27 Thread Igor Stasenko
On 27 June 2013 18:33, Stéphane Ducasse stephane.duca...@inria.fr wrote: Igor we should document such mistakes This is important can you add such comments in class comment? Well, it is a general rule to never operate with pointers to moveable objects, because objects may change their locations

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-06-27 Thread kilon
Ok we solved that problem lest move to the next one. I have this line of code Glint status; to be used in this glGetShaderiv(shader, GL_COMPILE_STATUS, status); Now my first thought was to do this statusAdress := NativeBoost allocate: NBOpenGLTypes GLint. but of course NBOpenGLTypes GLint

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-06-26 Thread kilon
My code gl shaderSource_shader: shader count: 1 string: shaderString length: 0. must not be correct. I try to translate this glShaderSource(shader, 1, strFileData, NULL); using the tutorial in here - http://www.arcsynthesis.org/gltut/Basics/Tut01%20Making%20Shaders.html

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-06-23 Thread Guy Hylton
Have you tried (gl getString: GL_VERSION) readString or if it does not return an NBExternalAddress (NBExternalAddress value: (gl getString: GL_VERSION)) readstring On Sat, Jun 22, 2013 at 4:46 PM, kilon theki...@yahoo.co.uk wrote: I am trying to find out what version of Opengl NBOpenGL is

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-06-23 Thread kilon
No I did not, because I dont have the brain power to assume that NBExternalAdress will have some methods to make my life easier. And of course it works like a charm now, thank you very much :) -- View this message in context: http://forum.world.st/Understanding-NBOpenGL-tp4686514p4694639.html

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-06-23 Thread kilon
next question . I have this method. initializeProgram create each shader and program | shaderList strVertexShader strFragmentShader | strVertexShader := self createShader: GL_VERTEX_SHADER string: ( self vertexShader ). strFragmentShader := self

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-06-23 Thread Marcus Denker
On Jun 23, 2013, at 4:52 PM, kilon theki...@yahoo.co.uk wrote: next question . I have this method. initializeProgram create each shader and program | shaderList strVertexShader strFragmentShader | strVertexShader := self createShader: GL_VERTEX_SHADER

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-06-23 Thread kilon
yeah and I read about that in PBE and of course I forgot about it. That is why we need the mailing lists. Ok that solved the problem partially it does not complain about strVertexShader but it still complains about strFragmentShader . I use this code. shaderList := {strVertexShader

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-06-23 Thread Marcus Denker
On Jun 23, 2013, at 5:51 PM, kilon theki...@yahoo.co.uk wrote: yeah and I read about that in PBE and of course I forgot about it. That is why we need the mailing lists. Ok that solved the problem partially it does not complain about strVertexShader but it still complains about

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-06-22 Thread kilon
I am trying to find out what version of Opengl NBOpenGL is using so I do: gl getString:GL_VERSION. it works and returns me a pointer. I looked at definition of methods and it is defined to return a pointer. Question is how I get the string that the pointer points too ? -- View this message

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-06-09 Thread Igor Stasenko
On 10 June 2013 03:54, Igor Stasenko siguc...@gmail.com wrote: On 9 June 2013 20:47, kilon theki...@yahoo.co.uk wrote: Ok I am moving towards the direction you indicated , its just takes time because I am clueless. Af far as macos is concerned I was sucessful into intialising opengl context

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-06-04 Thread Igor Stasenko
On 4 June 2013 11:40, kilon theki...@yahoo.co.uk wrote: Ok new problem, NBOpengl seems to not work at all on my UBUNTU 12.10 machine. I was trying to do GLViewportMorph new openInWorld , which works fine on my iMac and it gave me error: function unavailable. So I assumed it cannot find some

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-05-25 Thread Igor Stasenko
On 22 May 2013 20:11, kilon theki...@yahoo.co.uk wrote: I am looking at NBGLContextDriver and NBGLDisplay and I see none of that hard coded stuff. Look more carefully: there's a code to manage viewport and setting up buffers and other things, like blend more etc in those classes. It is not

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-05-25 Thread kilon
ok i see, well I did not mean that we dont need platform specific code, of course we do. thanks for adding me. I will first try to contribute some example classes that show how nbopengl can be used in practice. And see if I can fix any of the bugs I find. No problem if you dont have time, I

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-05-22 Thread kilon
Hey Igor , yes I would love to contrinbute to NBOpenGL for a very long time. I could at least fix those small errors like the one I reported and add documentation to methods and especially classes. I am using pharo 3.0 and GLTTRenderingDemo does not work. I get an error. Apparently it cannot

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-05-22 Thread kilon
I am looking at NBGLContextDriver and NBGLDisplay and I see none of that hard coded stuff. I assume you mean the platform specific packages like NBMacGLContextDriver ,NBGLXContextDriver etc. where I see alot of platform specific code inside the methods of those classes . -- View this message

Re: [Pharo-dev] [Pharo-project] Understanding NBOpenGL

2013-05-17 Thread Igor Stasenko
On 17 May 2013 10:21, kilon theki...@yahoo.co.uk wrote: Thank you all for your replies. I have used the solution I get new errors now. Is there an example how to create a context with NBOpenGL because the examples NBOpenGL is coming with are confusing at best ? Pharo2.0 Latest update: #20590