Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 1 participants
- 144619 messages
Re: [Pharo-project] more evidence that I am a newbie
by Lawson English
Igor Stasenko wrote:
> On 16 April 2010 03:32, Lawson English <lenglish5(a)cox.net> wrote:
>
>> Henrik Sperre Johansen wrote:
>>
>>> On 16.04.2010 01:10, Lawson English wrote:
>>>
>>>> Igor Stasenko wrote:
>>>>
>>>>> On 15 April 2010 23:02, Lawson English <lenglish5(a)cox.net> wrote:
>>>>>
>>>>>> I tried to load Andreas Raab's ffi-based OpenGL packages into Pharo
>>>>>> 1.0...
>>>>>>
>>>>>>
>>>>>> (Installer repository: 'http://source.squeak.org/FFI')
>>>>>> install: 'FFI-Pools';
>>>>>> install: 'FFI-Kernel';
>>>>>> install: 'FFI-Tests'.
>>>>>>
>>>>>> (Installer repository: 'http://www.squeaksource.com/CroquetGL')
>>>>>> install: '3DTransform';
>>>>>> install: 'OpenGL-Pools';
>>>>>> install: 'OpenGL-Core'.
>>>>>>
>>>>>> OpenGL example
>>>>>>
>>>>>> I wasn't quite sure how to load them with Gofer so I did it manually
>>>>>> with
>>>>>> Monticello.
>>>>>>
>>>>>> However, when I "doIt" with 'OpenGL example'
>>>>>>
>>>>>> I get the error:
>>>>>>
>>>>>> MessageNotUnderstood: SystemDictionary>>platformName
>>>>>> OpenGL class>>new
>>>>>> OpenGL class>>newIn:
>>>>>> OpenGL example
>>>>>>
>>>>>>
>>>>>> No doubt its something totally trivial... Suggestions?
>>>>>>
>>>>>>
>>>>> Select a #platformname selector with mouse , and then press alt-m to
>>>>> see who implements that message.
>>>>> Then try sending it from workspace until to make sure you found right
>>>>> implementor.
>>>>> Then modify the source code in OpenGL class>>new accordingly.
>>>>> ;)
>>>>>
>>>> Unfortunately lots of nested references to it, starting with Smalltalk
>>>> platformName.
>>>>
>>>> I can get as far as changing it to SmalltalkImage current platformName
>>>> but things get strange after that...
>>>>
>>>> new
>>>> Smalltalk platformName = 'Win32' ifTrue:[^OGLWin32 basicNew
>>>> initialize].
>>>> Smalltalk platformName = 'unix'
>>>> ifTrue:
>>>> [(Smalltalk windowSystemName = 'Quartz')
>>>> "implicitly big endian"
>>>> ifTrue: [^OGLUnixQuartz basicNew initialize].
>>>> "default to X11 window system"
>>>> Smalltalk isLittleEndian
>>>> ifTrue: [^OGLUnixX11LE basicNew initialize]
>>>> ifFalse: [^OGLUnixX11BE basicNew initialize]].
>>>> Smalltalk platformName = 'Mac OS' ifTrue:[
>>>> Smalltalk osVersion asNumber < 1000
>>>> ifTrue: [^OGLMacOS9 basicNew initialize]
>>>> ifFalse:[^OGLMacOSX basicNew initialize].
>>>> ].
>>>> ^self error:'Cannot identify platform'
>>>>
>>> Try replacing windowSystemName with (SmalltalkImage current
>>> getSystemAttribute: 1005).
>>>
>>> 1.0 (1.1 too, actually) does not include some of the abstraction methods
>>> introduced in Squeak, which OpenGL uses.
>>>
>>>
>> Sob... Almost...
>>
>> Worked my way through everything and now it blows up AFTER reserving an OGL
>> context (there's an blank rectangle in the window at least) with the error:
>>
>> improper store into indexable object
>>
>> at the line ensure:[ogl destroy].
>>
>> in OpenGL>>example
>>
>> example "OpenGL example"
>> "A very simple OpenGL example"
>>
>> | ogl frames startTime deltaTime framesPerSec bounds font |
>> font := StrikeFont familyName: 'Atlanta' pointSize: 11.
>> bounds := 0@0 extent: 400@400.
>> ogl := OpenGL newIn: bounds.
>> ogl ifNil:[^self error: 'Unable to create renderer'].
>> [frames := 0.
>> startTime := Time millisecondClockValue.
>> [Sensor anyButtonPressed] whileFalse:[
>> "start counting at second frame since first frame is penalized
>> by the upload of the bitmap font outside of ogl."
>> frames = 1 ifTrue:[startTime := Time millisecondClockValue].
>> ogl beginFrame.
>>
>> "--- this is the actual scene content ---"
>>
>> ogl glDisable: GLDepthTest. "for the simple example only"
>> ogl glDisable: GLLighting. "for the simple example only"
>>
>> ogl glClearColor: 1.0 with: 1.0 with: 1.0 with: 1.0.
>> ogl glClear: GLColorBufferBit.
>>
>> ogl glRotatef: 5.0 with: 0.0 with: 0.0 with: 1.0.
>> ogl glColor3f: 1.0 with: 0.0 with: 0.0.
>>
>> ogl glBegin: GLPolygon.
>> ogl glVertex2f: -0.7 with: -0.7.
>> ogl glVertex2f: 0.7 with: -0.7.
>> ogl glVertex2f: 0.7 with: 0.7.
>> ogl glVertex2f: -0.7 with: 0.7.
>> ogl glEnd.
>>
>> "--- here is the 2d overlay setup ---"
>>
>> ogl glMatrixMode: GLProjection.
>> ogl glPushMatrix.
>> ogl glLoadIdentity.
>> ogl glMatrixMode: GLModelview.
>> ogl glPushMatrix.
>> ogl glLoadIdentity.
>> ogl glTranslated: -1 with: 1 with: 0.0.
>> ogl glScaled: (2.0 / bounds width) with: (-2.0 / bounds height) with:
>> 1.0.
>> ogl glDisable: GLDepthTest.
>> ogl glEnable: GLBlend.
>> ogl glBlendFunc: GLOne with: GLOneMinusSrcAlpha.
>>
>> "--- here is the 2d overlay rendering ---"
>> deltaTime := Time millisecondsSince: startTime.
>> framesPerSec := frames * 1000 / (deltaTime max: 1) asFloat.
>> "@@@@: Fixme. It appears as if #drawString: depends on glColor
>> being set.
>> Makes no sense but I'm not going to figure this out - probably some
>> mishap
>> wrt. GLLighting being disabled."
>>
>
> it makes sense.
> The font is a bit mask, which defines an opaque and (semi)transparent pixels,
> not black and white ones.
> So, you need to provide a color, which will be used to paint opaque pixels.
>
>
That was a comment by the original programmer. I'm hopelessly confused
at this point... :-/
>> ogl glColor3f: 0.0 with: 0.0 with: 0.0.
>> ogl drawString: frames printString, ' frames: ', (framesPerSec
>> truncateTo: 0.1), ' fps'
>> at: 0@font height@0 font: font color: Color black.
>>
>> ogl glDisable: GLBlend.
>> ogl glMatrixMode: GLModelview.
>> ogl glPopMatrix.
>> ogl glMatrixMode: GLProjection.
>> ogl glPopMatrix.
>> ogl glMatrixMode: GLModelview.
>>
>> "--- end the end frame operations"
>>
>> ogl endFrame.
>> ogl swapBuffers.
>> frames := frames + 1.
>> ].
>> ] ensure:[ogl destroy].
>>
>> _______________________________________________
>> Pharo-project mailing list
>> Pharo-project(a)lists.gforge.inria.fr
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>
>
>
>
April 16, 2010
Re: [Pharo-project] more evidence that I am a newbie
by Igor Stasenko
On 16 April 2010 03:32, Lawson English <lenglish5(a)cox.net> wrote:
> Henrik Sperre Johansen wrote:
>>
>> Â On 16.04.2010 01:10, Lawson English wrote:
>>>
>>> Igor Stasenko wrote:
>>>>
>>>> On 15 April 2010 23:02, Lawson English <lenglish5(a)cox.net> wrote:
>>>>>
>>>>> I tried to load Andreas Raab's ffi-based OpenGL packages into Pharo
>>>>> 1.0...
>>>>>
>>>>>
>>>>> (Installer repository: 'http://source.squeak.org/FFI')
>>>>> Â install: 'FFI-Pools';
>>>>> Â install: 'FFI-Kernel';
>>>>> Â install: 'FFI-Tests'.
>>>>>
>>>>> (Installer repository: 'http://www.squeaksource.com/CroquetGL')
>>>>> Â install: '3DTransform';
>>>>> Â install: 'OpenGL-Pools';
>>>>> Â install: 'OpenGL-Core'.
>>>>>
>>>>> OpenGL example
>>>>>
>>>>> I wasn't quite sure how to load them with Gofer so I did it manually
>>>>> with
>>>>> Monticello.
>>>>>
>>>>> However, when I "doIt" with 'OpenGL example'
>>>>>
>>>>> I get the error:
>>>>>
>>>>> MessageNotUnderstood: SystemDictionary>>platformName
>>>>> OpenGL class>>new
>>>>> OpenGL class>>newIn:
>>>>> OpenGL example
>>>>>
>>>>>
>>>>> No doubt its something totally trivial... Suggestions?
>>>>>
>>>> Select a #platformname selector with mouse , and then press alt-m to
>>>> see who implements that message.
>>>> Then try sending it from workspace until to make sure you found right
>>>> implementor.
>>>> Then modify the source code in OpenGL class>>new accordingly.
>>>> ;)
>>>
>>> Unfortunately lots of nested references to it, starting with Smalltalk
>>> platformName.
>>>
>>> I can get as far as changing it to SmalltalkImage current platformName
>>> but things get strange after that...
>>>
>>> new
>>> Â Smalltalk platformName = 'Win32' ifTrue:[^OGLWin32 basicNew
>>> initialize].
>>> Â Smalltalk platformName = 'unix'
>>> Â Â Â ifTrue:
>>> Â Â Â Â Â [(Smalltalk windowSystemName = 'Quartz')
>>> Â Â Â Â Â Â Â "implicitly big endian"
>>> Â Â Â Â Â Â Â ifTrue: [^OGLUnixQuartz basicNew initialize].
>>> Â Â Â Â Â Â Â "default to X11 window system"
>>> Â Â Â Â Â Â Â Smalltalk isLittleEndian
>>> Â Â Â Â Â Â Â Â Â ifTrue: [^OGLUnixX11LE basicNew initialize]
>>> Â Â Â Â Â Â Â Â Â ifFalse: [^OGLUnixX11BE basicNew initialize]].
>>> Â Smalltalk platformName = 'Mac OS' ifTrue:[
>>> Â Â Â Smalltalk osVersion asNumber < 1000
>>> Â Â Â Â Â ifTrue: [^OGLMacOS9 basicNew initialize]
>>> Â Â Â Â Â ifFalse:[^OGLMacOSX basicNew initialize].
>>> Â ].
>>> Â ^self error:'Cannot identify platform'
>>
>> Try replacing windowSystemName with (SmalltalkImage current
>> getSystemAttribute: 1005).
>>
>> 1.0 (1.1 too, actually) does not include some of the abstraction methods
>> introduced in Squeak, which OpenGL uses.
>>
> Sob... Almost...
>
> Worked my way through everything and now it blows up AFTER reserving an OGL
> context (there's an blank rectangle in the window at least) with the error:
>
> improper store into indexable object
>
> at the line  ensure:[ogl destroy].
>
> in OpenGL>>example
>
> example   "OpenGL example"
> Â "A very simple OpenGL example"
>
> Â | ogl frames startTime deltaTime framesPerSec bounds font |
> Â font := StrikeFont familyName: 'Atlanta' pointSize: 11.
> Â bounds := 0@0 extent: 400@400.
> Â ogl := OpenGL newIn: bounds.
> Â ogl ifNil:[^self error: 'Unable to create renderer'].
> Â [frames := 0.
> Â startTime := Time millisecondClockValue.
> Â [Sensor anyButtonPressed] whileFalse:[
> Â Â Â "start counting at second frame since first frame is penalized
> Â Â Â by the upload of the bitmap font outside of ogl."
> Â Â Â frames = 1 ifTrue:[startTime := Time millisecondClockValue].
> Â Â Â ogl beginFrame.
>
> Â "--- this is the actual scene content ---"
>
> Â Â Â ogl glDisable: GLDepthTest. Â Â "for the simple example only"
> Â Â Â ogl glDisable: GLLighting. Â Â Â Â "for the simple example only"
>
> Â Â Â ogl glClearColor: 1.0 with: 1.0 with: 1.0 with: 1.0.
> Â Â Â ogl glClear: GLColorBufferBit.
>
> Â Â Â ogl glRotatef: 5.0 with: 0.0 with: 0.0 with: 1.0.
> Â Â Â ogl glColor3f: 1.0 with: 0.0 with: 0.0.
>
> Â Â Â ogl glBegin: GLPolygon.
> Â Â Â Â Â ogl glVertex2f: -0.7 with: -0.7.
> Â Â Â Â Â ogl glVertex2f: Â 0.7 with: -0.7.
> Â Â Â Â Â ogl glVertex2f: Â 0.7 with: Â 0.7.
> Â Â Â Â Â ogl glVertex2f: -0.7 with: Â 0.7.
> Â Â Â ogl glEnd.
>
> Â "--- here is the 2d overlay setup ---"
>
> Â Â Â ogl glMatrixMode: GLProjection.
> Â Â Â ogl glPushMatrix.
> Â Â Â ogl glLoadIdentity.
> Â Â Â ogl glMatrixMode: GLModelview.
> Â Â Â ogl glPushMatrix.
> Â Â Â ogl glLoadIdentity.
> Â Â Â ogl glTranslated: -1 with: 1 with: 0.0.
> Â Â Â ogl glScaled: (2.0 / bounds width) with: (-2.0 / bounds height) with:
> 1.0.
> Â Â Â ogl glDisable: GLDepthTest.
> Â Â Â ogl glEnable: GLBlend.
> Â Â Â ogl glBlendFunc: GLOne with: GLOneMinusSrcAlpha.
>
> Â "--- here is the 2d overlay rendering ---"
> Â Â Â deltaTime := Time millisecondsSince: startTime.
> Â Â Â framesPerSec := frames * 1000 / (deltaTime max: 1) asFloat.
> Â Â Â Â Â Â "@@@@: Fixme. It appears as if #drawString: depends on glColor
> being set.
> Â Â Â Makes no sense but I'm not going to figure this out - probably some
> mishap
> Â Â Â wrt. GLLighting being disabled."
it makes sense.
The font is a bit mask, which defines an opaque and (semi)transparent pixels,
not black and white ones.
So, you need to provide a color, which will be used to paint opaque pixels.
> Â Â Â ogl glColor3f: 0.0 with: 0.0 with: 0.0.
> Â Â Â ogl drawString: frames printString, ' frames: ', (framesPerSec
> truncateTo: 0.1), ' fps'
> Â Â Â Â Â at: 0@font height@0 font: font color: Color black.
>
> Â Â Â ogl glDisable: GLBlend.
> Â Â Â ogl glMatrixMode: GLModelview.
> Â Â Â ogl glPopMatrix.
> Â Â Â ogl glMatrixMode: GLProjection.
> Â Â Â ogl glPopMatrix.
> Â Â Â ogl glMatrixMode: GLModelview.
>
> Â "--- end the end frame operations"
>
> Â Â Â ogl endFrame.
> Â Â Â ogl swapBuffers.
> Â Â Â frames := frames + 1.
> Â ].
> Â ] ensure:[ogl destroy].
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
--
Best regards,
Igor Stasenko AKA sig.
April 16, 2010
Re: [Pharo-project] [squeak-dev] Re: iPhone OS 4 SDK, section 3.3.1
by csrabak@bol.com.br
IIUC it doesn't matter because one of the other prohibitions of the section 3.3.1 is the use of 'foreign runtimes' so any interpreted language that they've not listed is out...
Em 15/04/2010 17:11, Stéphane Ducasse < stephane.ducasse(a)inria.fr > escreveu:
Thanks for the info. But let us see because we do not know if a squeak-vm is an C or smalltalk app.
Stef
> Not to defend Apple's hubris or anything, but John's other apps written in Squeak are still in the store. Scratch was not taken down because it is implemented in Squeak, but because it downloads code from the internet and runs it.
>
> - Bert -
>
> On 15.04.2010, at 21:20, stephane ducasse wrote:
>
>>
>> Yes extremely sad.
>> I imagine that you saw my mail on esug-list.
>>
>>
>> On Apr 15, 2010, at 8:50 PM, Juan Vuletich wrote:
>>
>>> Andreas Raab wrote:
>>>> On 4/8/2010 2:43 PM, Sean Malloy wrote:
>>>>> Anyone have any thoughts on this change to the agreement?
>>>>
>>>> Just in case anyone had any illusions on this:
>>>>
>>>> http://computinged.wordpress.com/2010/04/15/apple-removes-scratch-from-ipad…
>>>>
>>>> Cheers,
>>>> - Andreas
>>>
>>> Oh! How silly then can be!
>>>
>>> :(
>>> Juan Vuletich
>>>
>>
>>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________
Pharo-project mailing list
Pharo-project(a)lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
April 16, 2010
Re: [Pharo-project] more evidence that I am a newbie
by Lawson English
Lawson English wrote:
> Lawson English wrote:
>> Sob... Almost...
>>
>> Worked my way through everything and now it blows up AFTER reserving
>> an OGL context (there's an blank rectangle in the window at least)
>> with the error:
>>
>> improper store into indexable object
>>
>>
>
> my bad. Was at
>
> ', (framesPerSec truncateTo: 0.1),
>
>
> in line
>
> ogl drawString: frames printString, ' frames: ', (framesPerSec
> truncateTo: 0.1), ' fps'
> at: 0@font height@0 font: font color: Color black.
Sobs again. reran code again and the error line was indeed
] ensure:[ogl destroy].
shrug.
April 16, 2010
Re: [Pharo-project] more evidence that I am a newbie
by Lawson English
Lawson English wrote:
> Sob... Almost...
>
> Worked my way through everything and now it blows up AFTER reserving
> an OGL context (there's an blank rectangle in the window at least)
> with the error:
>
> improper store into indexable object
>
>
my bad. Was at
', (framesPerSec truncateTo: 0.1),
in line
ogl drawString: frames printString, ' frames: ', (framesPerSec
truncateTo: 0.1), ' fps'
at: 0@font height@0 font: font color: Color black.
>
> in OpenGL>>example
>
> example "OpenGL example"
> "A very simple OpenGL example"
>
> | ogl frames startTime deltaTime framesPerSec bounds font |
> font := StrikeFont familyName: 'Atlanta' pointSize: 11.
> bounds := 0@0 extent: 400@400.
> ogl := OpenGL newIn: bounds.
> ogl ifNil:[^self error: 'Unable to create renderer'].
> [frames := 0.
> startTime := Time millisecondClockValue.
> [Sensor anyButtonPressed] whileFalse:[
> "start counting at second frame since first frame is penalized
> by the upload of the bitmap font outside of ogl."
> frames = 1 ifTrue:[startTime := Time millisecondClockValue].
> ogl beginFrame.
>
> "--- this is the actual scene content ---"
>
> ogl glDisable: GLDepthTest. "for the simple example only"
> ogl glDisable: GLLighting. "for the simple example only"
>
> ogl glClearColor: 1.0 with: 1.0 with: 1.0 with: 1.0.
> ogl glClear: GLColorBufferBit.
>
> ogl glRotatef: 5.0 with: 0.0 with: 0.0 with: 1.0.
> ogl glColor3f: 1.0 with: 0.0 with: 0.0.
>
> ogl glBegin: GLPolygon.
> ogl glVertex2f: -0.7 with: -0.7.
> ogl glVertex2f: 0.7 with: -0.7.
> ogl glVertex2f: 0.7 with: 0.7.
> ogl glVertex2f: -0.7 with: 0.7.
> ogl glEnd.
>
> "--- here is the 2d overlay setup ---"
>
> ogl glMatrixMode: GLProjection.
> ogl glPushMatrix.
> ogl glLoadIdentity.
> ogl glMatrixMode: GLModelview.
> ogl glPushMatrix.
> ogl glLoadIdentity.
> ogl glTranslated: -1 with: 1 with: 0.0.
> ogl glScaled: (2.0 / bounds width) with: (-2.0 / bounds height)
> with: 1.0.
> ogl glDisable: GLDepthTest.
> ogl glEnable: GLBlend.
> ogl glBlendFunc: GLOne with: GLOneMinusSrcAlpha.
>
> "--- here is the 2d overlay rendering ---"
> deltaTime := Time millisecondsSince: startTime.
> framesPerSec := frames * 1000 / (deltaTime max: 1) asFloat.
> "@@@@: Fixme. It appears as if #drawString: depends on
> glColor being set.
> Makes no sense but I'm not going to figure this out - probably
> some mishap
> wrt. GLLighting being disabled."
> ogl glColor3f: 0.0 with: 0.0 with: 0.0.
> ogl drawString: frames printString, ' frames: ', (framesPerSec
> truncateTo: 0.1), ' fps'
> at: 0@font height@0 font: font color: Color black.
>
> ogl glDisable: GLBlend.
> ogl glMatrixMode: GLModelview.
> ogl glPopMatrix.
> ogl glMatrixMode: GLProjection.
> ogl glPopMatrix.
> ogl glMatrixMode: GLModelview.
>
> "--- end the end frame operations"
>
> ogl endFrame.
> ogl swapBuffers.
> frames := frames + 1.
> ].
> ] ensure:[ogl destroy].
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
April 16, 2010
Re: [Pharo-project] more evidence that I am a newbie
by Lawson English
Henrik Sperre Johansen wrote:
> On 16.04.2010 01:10, Lawson English wrote:
>> Igor Stasenko wrote:
>>> On 15 April 2010 23:02, Lawson English <lenglish5(a)cox.net> wrote:
>>>> I tried to load Andreas Raab's ffi-based OpenGL packages into Pharo
>>>> 1.0...
>>>>
>>>>
>>>> (Installer repository: 'http://source.squeak.org/FFI')
>>>> install: 'FFI-Pools';
>>>> install: 'FFI-Kernel';
>>>> install: 'FFI-Tests'.
>>>>
>>>> (Installer repository: 'http://www.squeaksource.com/CroquetGL')
>>>> install: '3DTransform';
>>>> install: 'OpenGL-Pools';
>>>> install: 'OpenGL-Core'.
>>>>
>>>> OpenGL example
>>>>
>>>> I wasn't quite sure how to load them with Gofer so I did it
>>>> manually with
>>>> Monticello.
>>>>
>>>> However, when I "doIt" with 'OpenGL example'
>>>>
>>>> I get the error:
>>>>
>>>> MessageNotUnderstood: SystemDictionary>>platformName
>>>> OpenGL class>>new
>>>> OpenGL class>>newIn:
>>>> OpenGL example
>>>>
>>>>
>>>> No doubt its something totally trivial... Suggestions?
>>>>
>>> Select a #platformname selector with mouse , and then press alt-m to
>>> see who implements that message.
>>> Then try sending it from workspace until to make sure you found right
>>> implementor.
>>> Then modify the source code in OpenGL class>>new accordingly.
>>> ;)
>>
>> Unfortunately lots of nested references to it, starting with
>> Smalltalk platformName.
>>
>> I can get as far as changing it to SmalltalkImage current
>> platformName but things get strange after that...
>>
>> new
>> Smalltalk platformName = 'Win32' ifTrue:[^OGLWin32 basicNew
>> initialize].
>> Smalltalk platformName = 'unix'
>> ifTrue:
>> [(Smalltalk windowSystemName = 'Quartz')
>> "implicitly big endian"
>> ifTrue: [^OGLUnixQuartz basicNew initialize].
>> "default to X11 window system"
>> Smalltalk isLittleEndian
>> ifTrue: [^OGLUnixX11LE basicNew initialize]
>> ifFalse: [^OGLUnixX11BE basicNew initialize]].
>> Smalltalk platformName = 'Mac OS' ifTrue:[
>> Smalltalk osVersion asNumber < 1000
>> ifTrue: [^OGLMacOS9 basicNew initialize]
>> ifFalse:[^OGLMacOSX basicNew initialize].
>> ].
>> ^self error:'Cannot identify platform'
> Try replacing windowSystemName with (SmalltalkImage current
> getSystemAttribute: 1005).
>
> 1.0 (1.1 too, actually) does not include some of the abstraction
> methods introduced in Squeak, which OpenGL uses.
>
Sob... Almost...
Worked my way through everything and now it blows up AFTER reserving an
OGL context (there's an blank rectangle in the window at least) with the
error:
improper store into indexable object
at the line ensure:[ogl destroy].
in OpenGL>>example
example "OpenGL example"
"A very simple OpenGL example"
| ogl frames startTime deltaTime framesPerSec bounds font |
font := StrikeFont familyName: 'Atlanta' pointSize: 11.
bounds := 0@0 extent: 400@400.
ogl := OpenGL newIn: bounds.
ogl ifNil:[^self error: 'Unable to create renderer'].
[frames := 0.
startTime := Time millisecondClockValue.
[Sensor anyButtonPressed] whileFalse:[
"start counting at second frame since first frame is penalized
by the upload of the bitmap font outside of ogl."
frames = 1 ifTrue:[startTime := Time millisecondClockValue].
ogl beginFrame.
"--- this is the actual scene content ---"
ogl glDisable: GLDepthTest. "for the simple example only"
ogl glDisable: GLLighting. "for the simple example only"
ogl glClearColor: 1.0 with: 1.0 with: 1.0 with: 1.0.
ogl glClear: GLColorBufferBit.
ogl glRotatef: 5.0 with: 0.0 with: 0.0 with: 1.0.
ogl glColor3f: 1.0 with: 0.0 with: 0.0.
ogl glBegin: GLPolygon.
ogl glVertex2f: -0.7 with: -0.7.
ogl glVertex2f: 0.7 with: -0.7.
ogl glVertex2f: 0.7 with: 0.7.
ogl glVertex2f: -0.7 with: 0.7.
ogl glEnd.
"--- here is the 2d overlay setup ---"
ogl glMatrixMode: GLProjection.
ogl glPushMatrix.
ogl glLoadIdentity.
ogl glMatrixMode: GLModelview.
ogl glPushMatrix.
ogl glLoadIdentity.
ogl glTranslated: -1 with: 1 with: 0.0.
ogl glScaled: (2.0 / bounds width) with: (-2.0 / bounds height)
with: 1.0.
ogl glDisable: GLDepthTest.
ogl glEnable: GLBlend.
ogl glBlendFunc: GLOne with: GLOneMinusSrcAlpha.
"--- here is the 2d overlay rendering ---"
deltaTime := Time millisecondsSince: startTime.
framesPerSec := frames * 1000 / (deltaTime max: 1) asFloat.
"@@@@: Fixme. It appears as if #drawString: depends on glColor
being set.
Makes no sense but I'm not going to figure this out - probably
some mishap
wrt. GLLighting being disabled."
ogl glColor3f: 0.0 with: 0.0 with: 0.0.
ogl drawString: frames printString, ' frames: ', (framesPerSec
truncateTo: 0.1), ' fps'
at: 0@font height@0 font: font color: Color black.
ogl glDisable: GLBlend.
ogl glMatrixMode: GLModelview.
ogl glPopMatrix.
ogl glMatrixMode: GLProjection.
ogl glPopMatrix.
ogl glMatrixMode: GLModelview.
"--- end the end frame operations"
ogl endFrame.
ogl swapBuffers.
frames := frames + 1.
].
] ensure:[ogl destroy].
April 16, 2010
Re: [Pharo-project] more evidence that I am a newbie
by Henrik Sperre Johansen
On 16.04.2010 01:10, Lawson English wrote:
> Igor Stasenko wrote:
>> On 15 April 2010 23:02, Lawson English <lenglish5(a)cox.net> wrote:
>>> I tried to load Andreas Raab's ffi-based OpenGL packages into Pharo
>>> 1.0...
>>>
>>>
>>> (Installer repository: 'http://source.squeak.org/FFI')
>>> install: 'FFI-Pools';
>>> install: 'FFI-Kernel';
>>> install: 'FFI-Tests'.
>>>
>>> (Installer repository: 'http://www.squeaksource.com/CroquetGL')
>>> install: '3DTransform';
>>> install: 'OpenGL-Pools';
>>> install: 'OpenGL-Core'.
>>>
>>> OpenGL example
>>>
>>> I wasn't quite sure how to load them with Gofer so I did it manually
>>> with
>>> Monticello.
>>>
>>> However, when I "doIt" with 'OpenGL example'
>>>
>>> I get the error:
>>>
>>> MessageNotUnderstood: SystemDictionary>>platformName
>>> OpenGL class>>new
>>> OpenGL class>>newIn:
>>> OpenGL example
>>>
>>>
>>> No doubt its something totally trivial... Suggestions?
>>>
>> Select a #platformname selector with mouse , and then press alt-m to
>> see who implements that message.
>> Then try sending it from workspace until to make sure you found right
>> implementor.
>> Then modify the source code in OpenGL class>>new accordingly.
>> ;)
>
> Unfortunately lots of nested references to it, starting with Smalltalk
> platformName.
>
> I can get as far as changing it to SmalltalkImage current platformName
> but things get strange after that...
>
> new
> Smalltalk platformName = 'Win32' ifTrue:[^OGLWin32 basicNew
> initialize].
> Smalltalk platformName = 'unix'
> ifTrue:
> [(Smalltalk windowSystemName = 'Quartz')
> "implicitly big endian"
> ifTrue: [^OGLUnixQuartz basicNew initialize].
> "default to X11 window system"
> Smalltalk isLittleEndian
> ifTrue: [^OGLUnixX11LE basicNew initialize]
> ifFalse: [^OGLUnixX11BE basicNew initialize]].
> Smalltalk platformName = 'Mac OS' ifTrue:[
> Smalltalk osVersion asNumber < 1000
> ifTrue: [^OGLMacOS9 basicNew initialize]
> ifFalse:[^OGLMacOSX basicNew initialize].
> ].
> ^self error:'Cannot identify platform'
Try replacing windowSystemName with (SmalltalkImage current
getSystemAttribute: 1005).
1.0 (1.1 too, actually) does not include some of the abstraction methods
introduced in Squeak, which OpenGL uses.
Cheers,
Henry
April 15, 2010
Re: [Pharo-project] more evidence that I am a newbie
by Lawson English
Igor Stasenko wrote:
> On 15 April 2010 23:02, Lawson English <lenglish5(a)cox.net> wrote:
>
>> I tried to load Andreas Raab's ffi-based OpenGL packages into Pharo 1.0...
>>
>>
>> (Installer repository: 'http://source.squeak.org/FFI')
>> install: 'FFI-Pools';
>> install: 'FFI-Kernel';
>> install: 'FFI-Tests'.
>>
>> (Installer repository: 'http://www.squeaksource.com/CroquetGL')
>> install: '3DTransform';
>> install: 'OpenGL-Pools';
>> install: 'OpenGL-Core'.
>>
>> OpenGL example
>>
>> I wasn't quite sure how to load them with Gofer so I did it manually with
>> Monticello.
>>
>> However, when I "doIt" with 'OpenGL example'
>>
>> I get the error:
>>
>> MessageNotUnderstood: SystemDictionary>>platformName
>> OpenGL class>>new
>> OpenGL class>>newIn:
>> OpenGL example
>>
>>
>> No doubt its something totally trivial... Suggestions?
>>
>>
> Select a #platformname selector with mouse , and then press alt-m to
> see who implements that message.
> Then try sending it from workspace until to make sure you found right
> implementor.
> Then modify the source code in OpenGL class>>new accordingly.
> ;)
>
Unfortunately lots of nested references to it, starting with Smalltalk
platformName.
I can get as far as changing it to SmalltalkImage current platformName
but things get strange after that...
new
Smalltalk platformName = 'Win32' ifTrue:[^OGLWin32 basicNew initialize].
Smalltalk platformName = 'unix'
ifTrue:
[(Smalltalk windowSystemName = 'Quartz')
"implicitly big endian"
ifTrue: [^OGLUnixQuartz basicNew initialize].
"default to X11 window system"
Smalltalk isLittleEndian
ifTrue: [^OGLUnixX11LE basicNew initialize]
ifFalse: [^OGLUnixX11BE basicNew initialize]].
Smalltalk platformName = 'Mac OS' ifTrue:[
Smalltalk osVersion asNumber < 1000
ifTrue: [^OGLMacOS9 basicNew initialize]
ifFalse:[^OGLMacOSX basicNew initialize].
].
^self error:'Cannot identify platform'
April 15, 2010
[Pharo-project] Fwd: Re: Handle Close Event in Image - necessary for 1.0?
by Andreas Raab
Whoops. Accidentally sent to the wrong list :-)
- A.
-------- Original Message --------
Subject: Re: Handle Close Event in Image - necessary for 1.0?
Date: Thu, 15 Apr 2010 15:56:59 -0700
From: Andreas Raab <andreas.raab(a)gmx.de>
To: The general-purpose Squeak developers list
<squeak-dev(a)lists.squeakfoundation.org>
Hi -
Just as a reminder when you discuss VM stuff, make it a habit to include
vm-dev(a)lists.squeakfoundation.org. I don't read the Pharo list regularly
(I only checked it today due to the unfortunate Scratch development).
This whole issue was entirely unnecessary and could've been solved with
one message to vm-dev. Here is why:
The in-image close-event that is now generated by default in the Windows
VM has always been a settable entity. If you'll compare the 4.0.2 vs.
3.11.8 VMs the only difference in this area is that the preference
"EnableAltF4Quit" is now unset by default. To change it, edit your .ini
file to have:
EnableAltF4Quit = 1
and you will be back to the previous behavior. You can add this
trivially to your one-click (or other) setup. In fact, I'd recommend
going carefully through the other relevant vm settings and decide how
they should be set for your releases. They are documented here:
http://squeakvm.org/win32/settings.html
So next time, do include vm-dev when you have a vm issue.
Thanks for listening,
- Andreas
On 4/6/2010 3:22 AM, Torsten Bergmann wrote:
> I think I've found something that should be fixed
> before releasing 1.0 since it is meanwhile a major problem on Windows.
>
> In "old" Squeak/Pharo you could close the native world window
> using the "X" or hit ALT+F4 on Windows and the system
> asked you if you really want to close the whole Smalltalk system
> using a native dialog which was provided by the VM.
>
> With the new VM's (4.0.1 and 4.0.2 on Windows, see [1]) the native
> "window close event" is now dispatched from the VM into
> the image so it could be handled by Smalltalk code.
> This is currently not done/handled in Pharo. Only in Squeak so far.
>
> The recent Squeak trunk/release candidate already handles the
> event within the image and now provides an in-image dialog
> to ask the user to quit.
>
> So: in Pharo now NOTHING happens when you try to close the window
> using "X", you can only quit using the world menu - which is IMHO really
> a show stopper since you cant close using "X" or ALT+F4 (the key combination to close any windows program).
>
> Two possible options:
>
> A) we should handle the event now in-image similar to Squeak
> by fixing and integration issue 2131 (see [2]), so not only
> for 1.1. but also for 1.0
>
> B) release and distribute Pharo 1.0 with an old VM< 4.0
>
>
> BTW:
> You can get the old behavior on Windows by additionally using SHIFT, so
> SHIFT + ALT + F4 allows to close.
> But this is not very convinient, doesnt follow what the typical
> Windows user expects and one has to know about it...
>
> Bye
> T.
>
> [1] http://lists.squeakfoundation.org/pipermail/vm-dev/2010-March/004142.html
> [2] http://code.google.com/p/pharo/issues/detail?id=2131
>
April 15, 2010
[Pharo-project] Double line feeds in some method source
by Schwab,Wilhelm K
Hello all,
I built an image from the 1.0 image (congratulations/thanks to all!!!!) and have noticed that some of the method source has extra line feeds. So far, I have not noticed anything that the affected classes/methods/packages/etc. have in common.
Anyone else seeing this?
Bill
April 15, 2010