Opengl and Squeak

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
29 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Opengl and Squeak

Igor Stasenko
On 20 August 2012 11:19, dimitris chloupis <[hidden email]> wrote:
> Thank you all for your help. I decided to go with Opengl ES 2.0 . Many
> openglers have recommended to me Opengl ES 2 as a very nice subset of opengl
> that is both very powerful and way simpler to implement, so I will most
> likely use that for porting Morphic to opengl and maybe open the way for
> squeak/pharo android/ios port. Seems like a double win to me.  If I can
> automate the generation of the wrappers as already CroquetGL is doing it
> would be great.
>
You can adapt the
http://www.squeaksource.com/OpenGLSpecs.html
to automatically generate wrappers for your code.
This is what i using to generate wrappers for NBOpenGL.



--
Best regards,
Igor Stasenko.

Reply | Threaded
Open this post in threaded view
|

Re: Opengl and Squeak

kilon
Thank you I have downloaded that too and will study it. Since opengl and opengl es are very close , it should not be hard to modify it for es. 


From: Igor Stasenko [via Smalltalk] <[hidden email]>
To: kilon <[hidden email]>
Sent: Monday, 20 August 2012, 14:06
Subject: Re: Opengl and Squeak

On 20 August 2012 11:19, dimitris chloupis <[hidden email]> wrote:
> Thank you all for your help. I decided to go with Opengl ES 2.0 . Many
> openglers have recommended to me Opengl ES 2 as a very nice subset of opengl
> that is both very powerful and way simpler to implement, so I will most
> likely use that for porting Morphic to opengl and maybe open the way for
> squeak/pharo android/ios port. Seems like a double win to me.  If I can
> automate the generation of the wrappers as already CroquetGL is doing it
> would be great.
>
You can adapt the
http://www.squeaksource.com/OpenGLSpecs.html
to automatically generate wrappers for your code.
This is what i using to generate wrappers for NBOpenGL.



--
Best regards,
Igor Stasenko.




If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/Opengl-and-Squeak-tp4644265p4644629.html
To unsubscribe from Opengl and Squeak, click here.
NAML




Reply | Threaded
Open this post in threaded view
|

NB & Squeak (Re: [squeak-dev] Opengl and Squeak)

Levente Uzonyi-2
In reply to this post by Igor Stasenko
On Sat, 18 Aug 2012, Igor Stasenko wrote:

> On 17 August 2012 08:51, dimitris chloupis <[hidden email]> wrote:
>> Well if FFI works okish in squeak I dont have a need for nativeboost, since
>> I prefer to code in smalltalk than assembly.
>>
> You don't have to learn assembly to use OpenGL with Nativeboost.
> Also, replying to previous post, it supports all 3 major platforms -
> mac, unix and windows.
>
> As for making NB working on Squeak, except from VM there's only one
> significant change
> made in Pharo but not in Squeak (afaik) is to improve the debugger
> support for custom primitives.

Can you give us some pointers where to look for these changes?


Levente

>
>> I decided to continue my project 'Ephestos' is squeak, since Blender python
>> has been a complete failure, the opengl implementation is buggy , still
>> stuck to version 1.1 and it consumes CPU cycles like crazy (simple hand
>> morph system  consume 50% of my dual core) so fingers crossed it will works
>> with squeak. I dont care for fancy features like nativevboost if its buggy,
>> non cross platform and slow.
>>
>> Seems I am not getting replies from other than you lawson , I assume
>> something is wrong with my squeak-dev subscription.
>>
>> Anyway, will test FFI from CroquetGL and hopefully it will work for me
>> too.Thanks for the help.
>> ________________________________
>> From: Lawson English <[hidden email]>
>> To: [hidden email]
>> Sent: Thursday, 16 August 2012, 23:07
>>
>> Subject: Re: [squeak-dev] Opengl and Squeak
>>
>> thanks Hans-Martin. I'll update my videos with that bit of info too.
>>
>> I have been playing quite a bit with NativeBoost lately and it offers some
>> very nice features that anyone wanting to make a game or other realtime-ish
>> application will find beneficial, including the ability to create a
>> "cascade" of foreign file calls within a single method, or even program a
>> bit of custom x86 assembler. I don't know what will be involved to port it
>> to Squeak, but Igor's talk suggests that the only "special" bit is already
>> present in the VM, which should work with either Pharo or Squeak. The rest
>> is just glue code at the Smalltalk level, which means that it is perfectly
>> doable to get it working on Squeak, in theory at least.
>>
>> Native boost also offers a way of passing an arbitrary  ByteArray to an
>> external function as though it were a normal pointer to a bit of malloc-ed
>> memory, which can be VERY useful with certain libraries, that and the
>> ability to actually malloc memory for a ByteArray from the OS level heap,
>> opens up all sorts of possibilities like having an external lib render
>> directly into a BitMap object asynchronously from its own OS level thread so
>> that each update can show the library's progress in a morph without any
>> further coding.
>>
>> I'm actually working on a simple MandelBrot Set generator lib in C to demo
>> this.
>>
>> L.
>>
>>
>>
>> On 8/16/12 12:38 PM, Hans-Martin Mosner wrote:
>>> The Squeak OpenGL bindings are on squeaksource.com. Here is an older mail
>>> exchange describing the installation procedure:
>>> http://forum.world.st/OpenGL-in-4-1-or-later-td3794639.html I have just
>>> tried it in a 4.3 image, and after fixing three small glitches it worked: -
>>> somehow the method OGLUnix>>#openGLLibraryName has an illegal character at
>>> the end (it's probably being handled as whitespace in other Squeak/Pharo
>>> images) - the method Point>>#area does not exist. I implemented it as
>>> returning x*y, which works. - the method printShowingMaxDecimalPlaces: does
>>> not exist. I used printString instead. That should get you started. Cheers,
>>> Hans-Martin
>>
>>
>> -- Squeak from the very start (introduction to Squeak and Pharo Smalltalk
>> for the (almost) complete and compleate beginner).
>> https://www.youtube.com/playlist?list=PL6601A198DF14788D&feature=view_all
>>
>>
>>
>>
>>
>>
>>
>
>
>
> --
> Best regards,
> Igor Stasenko.
>
>

Reply | Threaded
Open this post in threaded view
|

Re: NB & Squeak (Re: [squeak-dev] Opengl and Squeak)

Igor Stasenko
On 21 August 2012 00:31, Levente Uzonyi <[hidden email]> wrote:

> On Sat, 18 Aug 2012, Igor Stasenko wrote:
>
>> On 17 August 2012 08:51, dimitris chloupis <[hidden email]> wrote:
>>>
>>> Well if FFI works okish in squeak I dont have a need for nativeboost,
>>> since
>>> I prefer to code in smalltalk than assembly.
>>>
>> You don't have to learn assembly to use OpenGL with Nativeboost.
>> Also, replying to previous post, it supports all 3 major platforms -
>> mac, unix and windows.
>>
>> As for making NB working on Squeak, except from VM there's only one
>> significant change
>> made in Pharo but not in Squeak (afaik) is to improve the debugger
>> support for custom primitives.
>
>
> Can you give us some pointers where to look for these changes?
>
>
Mainly it consists of two parts,
originally started by Mariano and then somewhat polished by me..
http://code.google.com/p/pharo/issues/detail?id=5459
(Mariano, can you please give a link to the issue for your changes,
because i don't remember it).

Also for a full context, where everything is started from please google for
"is there a way to avoid all the #tryNamedPrimitive:with: * in ProtoObject"
topic in pharo mailing list.

> Levente
>
>>
>>> I decided to continue my project 'Ephestos' is squeak, since Blender
>>> python
>>> has been a complete failure, the opengl implementation is buggy , still
>>> stuck to version 1.1 and it consumes CPU cycles like crazy (simple hand
>>> morph system  consume 50% of my dual core) so fingers crossed it will
>>> works
>>> with squeak. I dont care for fancy features like nativevboost if its
>>> buggy,
>>> non cross platform and slow.
>>>
>>> Seems I am not getting replies from other than you lawson , I assume
>>> something is wrong with my squeak-dev subscription.
>>>
>>> Anyway, will test FFI from CroquetGL and hopefully it will work for me
>>> too.Thanks for the help.
>>> ________________________________
>>> From: Lawson English <[hidden email]>
>>> To: [hidden email]
>>> Sent: Thursday, 16 August 2012, 23:07
>>>
>>> Subject: Re: [squeak-dev] Opengl and Squeak
>>>
>>> thanks Hans-Martin. I'll update my videos with that bit of info too.
>>>
>>> I have been playing quite a bit with NativeBoost lately and it offers
>>> some
>>> very nice features that anyone wanting to make a game or other
>>> realtime-ish
>>> application will find beneficial, including the ability to create a
>>> "cascade" of foreign file calls within a single method, or even program a
>>> bit of custom x86 assembler. I don't know what will be involved to port
>>> it
>>> to Squeak, but Igor's talk suggests that the only "special" bit is
>>> already
>>> present in the VM, which should work with either Pharo or Squeak. The
>>> rest
>>> is just glue code at the Smalltalk level, which means that it is
>>> perfectly
>>> doable to get it working on Squeak, in theory at least.
>>>
>>> Native boost also offers a way of passing an arbitrary  ByteArray to an
>>> external function as though it were a normal pointer to a bit of
>>> malloc-ed
>>> memory, which can be VERY useful with certain libraries, that and the
>>> ability to actually malloc memory for a ByteArray from the OS level heap,
>>> opens up all sorts of possibilities like having an external lib render
>>> directly into a BitMap object asynchronously from its own OS level thread
>>> so
>>> that each update can show the library's progress in a morph without any
>>> further coding.
>>>
>>> I'm actually working on a simple MandelBrot Set generator lib in C to
>>> demo
>>> this.
>>>
>>> L.
>>>
>>>
>>>
>>> On 8/16/12 12:38 PM, Hans-Martin Mosner wrote:
>>>>
>>>> The Squeak OpenGL bindings are on squeaksource.com. Here is an older
>>>> mail
>>>> exchange describing the installation procedure:
>>>> http://forum.world.st/OpenGL-in-4-1-or-later-td3794639.html I have just
>>>> tried it in a 4.3 image, and after fixing three small glitches it
>>>> worked: -
>>>> somehow the method OGLUnix>>#openGLLibraryName has an illegal character
>>>> at
>>>> the end (it's probably being handled as whitespace in other Squeak/Pharo
>>>> images) - the method Point>>#area does not exist. I implemented it as
>>>> returning x*y, which works. - the method printShowingMaxDecimalPlaces:
>>>> does
>>>> not exist. I used printString instead. That should get you started.
>>>> Cheers,
>>>> Hans-Martin
>>>
>>>
>>>
>>> -- Squeak from the very start (introduction to Squeak and Pharo Smalltalk
>>> for the (almost) complete and compleate beginner).
>>> https://www.youtube.com/playlist?list=PL6601A198DF14788D&feature=view_all
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>> --
>> Best regards,
>> Igor Stasenko.
>>
>>
>



--
Best regards,
Igor Stasenko.

Reply | Threaded
Open this post in threaded view
|

Re: NB & Squeak (Re: [squeak-dev] Opengl and Squeak)

Igor Stasenko
Aha, this is it:
http://code.google.com/p/pharo/issues/detail?id=5223

so, 5224 and 5459 contain the changes which made NativeBoost no longer
compatible
with Squeak.
Before i had an evil override in NB package to one of the kernel
methods in order to simulate
primitiveNativeCall primitive correctly.
After these changes, it is no longer needs to override but just
registering a custom primitive simulator in debugger. (I am not
mentioning other problems we solving with these changes).

On 21 August 2012 00:59, Igor Stasenko <[hidden email]> wrote:

> On 21 August 2012 00:31, Levente Uzonyi <[hidden email]> wrote:
>> On Sat, 18 Aug 2012, Igor Stasenko wrote:
>>
>>> On 17 August 2012 08:51, dimitris chloupis <[hidden email]> wrote:
>>>>
>>>> Well if FFI works okish in squeak I dont have a need for nativeboost,
>>>> since
>>>> I prefer to code in smalltalk than assembly.
>>>>
>>> You don't have to learn assembly to use OpenGL with Nativeboost.
>>> Also, replying to previous post, it supports all 3 major platforms -
>>> mac, unix and windows.
>>>
>>> As for making NB working on Squeak, except from VM there's only one
>>> significant change
>>> made in Pharo but not in Squeak (afaik) is to improve the debugger
>>> support for custom primitives.
>>
>>
>> Can you give us some pointers where to look for these changes?
>>
>>
> Mainly it consists of two parts,
> originally started by Mariano and then somewhat polished by me..
> http://code.google.com/p/pharo/issues/detail?id=5459
> (Mariano, can you please give a link to the issue for your changes,
> because i don't remember it).
>
> Also for a full context, where everything is started from please google for
> "is there a way to avoid all the #tryNamedPrimitive:with: * in ProtoObject"
> topic in pharo mailing list.
>
>> Levente
>>
>>>
>>>> I decided to continue my project 'Ephestos' is squeak, since Blender
>>>> python
>>>> has been a complete failure, the opengl implementation is buggy , still
>>>> stuck to version 1.1 and it consumes CPU cycles like crazy (simple hand
>>>> morph system  consume 50% of my dual core) so fingers crossed it will
>>>> works
>>>> with squeak. I dont care for fancy features like nativevboost if its
>>>> buggy,
>>>> non cross platform and slow.
>>>>
>>>> Seems I am not getting replies from other than you lawson , I assume
>>>> something is wrong with my squeak-dev subscription.
>>>>
>>>> Anyway, will test FFI from CroquetGL and hopefully it will work for me
>>>> too.Thanks for the help.
>>>> ________________________________
>>>> From: Lawson English <[hidden email]>
>>>> To: [hidden email]
>>>> Sent: Thursday, 16 August 2012, 23:07
>>>>
>>>> Subject: Re: [squeak-dev] Opengl and Squeak
>>>>
>>>> thanks Hans-Martin. I'll update my videos with that bit of info too.
>>>>
>>>> I have been playing quite a bit with NativeBoost lately and it offers
>>>> some
>>>> very nice features that anyone wanting to make a game or other
>>>> realtime-ish
>>>> application will find beneficial, including the ability to create a
>>>> "cascade" of foreign file calls within a single method, or even program a
>>>> bit of custom x86 assembler. I don't know what will be involved to port
>>>> it
>>>> to Squeak, but Igor's talk suggests that the only "special" bit is
>>>> already
>>>> present in the VM, which should work with either Pharo or Squeak. The
>>>> rest
>>>> is just glue code at the Smalltalk level, which means that it is
>>>> perfectly
>>>> doable to get it working on Squeak, in theory at least.
>>>>
>>>> Native boost also offers a way of passing an arbitrary  ByteArray to an
>>>> external function as though it were a normal pointer to a bit of
>>>> malloc-ed
>>>> memory, which can be VERY useful with certain libraries, that and the
>>>> ability to actually malloc memory for a ByteArray from the OS level heap,
>>>> opens up all sorts of possibilities like having an external lib render
>>>> directly into a BitMap object asynchronously from its own OS level thread
>>>> so
>>>> that each update can show the library's progress in a morph without any
>>>> further coding.
>>>>
>>>> I'm actually working on a simple MandelBrot Set generator lib in C to
>>>> demo
>>>> this.
>>>>
>>>> L.
>>>>
>>>>
>>>>
>>>> On 8/16/12 12:38 PM, Hans-Martin Mosner wrote:
>>>>>
>>>>> The Squeak OpenGL bindings are on squeaksource.com. Here is an older
>>>>> mail
>>>>> exchange describing the installation procedure:
>>>>> http://forum.world.st/OpenGL-in-4-1-or-later-td3794639.html I have just
>>>>> tried it in a 4.3 image, and after fixing three small glitches it
>>>>> worked: -
>>>>> somehow the method OGLUnix>>#openGLLibraryName has an illegal character
>>>>> at
>>>>> the end (it's probably being handled as whitespace in other Squeak/Pharo
>>>>> images) - the method Point>>#area does not exist. I implemented it as
>>>>> returning x*y, which works. - the method printShowingMaxDecimalPlaces:
>>>>> does
>>>>> not exist. I used printString instead. That should get you started.
>>>>> Cheers,
>>>>> Hans-Martin
>>>>
>>>>
>>>>
>>>> -- Squeak from the very start (introduction to Squeak and Pharo Smalltalk
>>>> for the (almost) complete and compleate beginner).
>>>> https://www.youtube.com/playlist?list=PL6601A198DF14788D&feature=view_all
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Best regards,
>>> Igor Stasenko.
>>>
>>>
>>
>
>
>
> --
> Best regards,
> Igor Stasenko.



--
Best regards,
Igor Stasenko.

Reply | Threaded
Open this post in threaded view
|

Re: Opengl and Squeak

Igor Stasenko
In reply to this post by kilon
On 20 August 2012 15:39, dimitris chloupis <[hidden email]> wrote:
> Thank you I have downloaded that too and will study it. Since opengl and
> opengl es are very close , it should not be hard to modify it for es.
>
Oh, yes and if you really want to know how it feels to code opengl
with nativeboost,
you can ask Erwan, who using NBOpenGL for his project.

AFAIK, Erwan didn't had to learn assembly in order to use it :)

--
Best regards,
Igor Stasenko.

Reply | Threaded
Open this post in threaded view
|

Re: Opengl and Squeak

LawsonEnglish
On 8/20/12 4:17 PM, Igor Stasenko wrote:

> On 20 August 2012 15:39, dimitris chloupis <[hidden email]> wrote:
>> Thank you I have downloaded that too and will study it. Since opengl and
>> opengl es are very close , it should not be hard to modify it for es.
>>
> Oh, yes and if you really want to know how it feels to code opengl
> with nativeboost,
> you can ask Erwan, who using NBOpenGL for his project.
>
> AFAIK, Erwan didn't had to learn assembly in order to use it :)
>
One or two of my OpenGL squeak videos (the later ones) are done using
NBOpenGL

L

--
Squeak from the very start (introduction to Squeak and Pharo Smalltalk for the (almost) complete and compleate beginner).
https://www.youtube.com/playlist?list=PL6601A198DF14788D&feature=view_all


Reply | Threaded
Open this post in threaded view
|

Re: Opengl and Squeak

Igor Stasenko
On 21 August 2012 01:27, Lawson English <[hidden email]> wrote:

> On 8/20/12 4:17 PM, Igor Stasenko wrote:
>>
>> On 20 August 2012 15:39, dimitris chloupis <[hidden email]> wrote:
>>>
>>> Thank you I have downloaded that too and will study it. Since opengl and
>>> opengl es are very close , it should not be hard to modify it for es.
>>>
>> Oh, yes and if you really want to know how it feels to code opengl
>> with nativeboost,
>> you can ask Erwan, who using NBOpenGL for his project.
>>
>> AFAIK, Erwan didn't had to learn assembly in order to use it :)
>>
> One or two of my OpenGL squeak videos (the later ones) are done using
> NBOpenGL
>

Yes, i seen the both (as well as many others you did), and i'd like to
thank you for your effort.


>
> L
>
> --
> Squeak from the very start (introduction to Squeak and Pharo Smalltalk for
> the (almost) complete and compleate beginner).
> https://www.youtube.com/playlist?list=PL6601A198DF14788D&feature=view_all
>
>



--
Best regards,
Igor Stasenko.

Reply | Threaded
Open this post in threaded view
|

Re: Opengl and Squeak

Igor Stasenko
Btw, the 'rough corners' artifacts which you see on those videos is
non-functional shaders on OSX 10.5
its interesting that same code works well on 10.4 , fails on 10.5 and
again works fine on 10.6

this demo, of course were not designed to go over all of the hops
that's why you see what you see.

P.S. And i must warn those who will try using OpenGL with more recent
VMs on jenkins:
- there are two flavors of VMs for Mac, the old one uses Carbon
framework, and more recent one uses Cocoa.
Since Apple willing to eventually drop support of Carbon in favor of
Cocoa, it is logical to migrate to Cocoa.
But migration also involved some changes, and one of them is pretty
nasty to the demo and NBOpenGL - a current implementation for
displaying bits on screen by VM also uses opengl.. and what happens is
that VM are "stealing" the active context from NB.. so unless you
modify the demo by putting "makeCurrent()" calls at certain places you
will no longer able to have it working properly.
Around a month ago we spent time with Esteban to implement an
alternative way for screen updating by VM, which does not involves
OpenGL, but it is not yet employed in current builds..
and i want to do that in closest future.


--
Best regards,
Igor Stasenko.

12