<div dir="ltr"><div><div><div><div><div><div><div>Sorry about the missing VM source. I am uploading the changes into my github repository: <a href="https://github.com/ronsaldo/pharo-vm">https://github.com/ronsaldo/pharo-vm</a><br>
<br></div><div></div>As for the details of loading a OSWindow into a Pharo image, there is a fogbugz issue with all the required instructions.<br><br></div><div>Now, OSWindow relies heavily on NativeBoost, so as for Squeak integration they would need to support it. Now, I am also working on a new FFI, which will allows NB to have a better integration with the existing VM. With the FFI iam working on, it should be possible to use NB for when machine code generation is forbidden. In this project I am having discussions and working with Igor, Esteban, Clement and Eliot.<br>
<br>Currently OSWindow is mostly for Pharo, but it should be possible to have it for more Smalltalks.<br><br></div><div>As for the existing VM windows, we removed it completely for Linux with Igor. In Pharo, we don&#39;t want to maintain that old code in C, because is huge, really hard to understand and it has his limitations. For example, with the old VM window we have to pass mouse wheel events as if there keyboard presses. Windows and Mac OS X are next.<br>
<br></div><div>In OSWindow, we receive the raw events that SDL2 or an operating system specific backend provide us. Later I will try it with a joystick.<br></div><div><br>------------------<br></div>-- VM Changes<br>----------------------<br>
</div><br>The SDL2Display plugin has the following code:<br><br><blockquote>extern struct VirtualMachine* interpreterProxy;<br>extern void setIoProcessEventsHandler(void * handler);<br><br>static int inited = 0;<br>static int inputSemaphoreIndex = 0;<br>
<br>/**<br> * Called by the VM heartbeat if installed, to check for the presence of events.<br> */<br>static void ioCheckForEvents() {<br>    if (inited) {<br>        SDL_PumpEvents();<br>        if (SDL_HasEvents(SDL_FIRSTEVENT, SDL_LASTEVENT)) {<br>
            interpreterProxy-&gt;signalSemaphoreWithIndex(inputSemaphoreIndex);<br>        }<br>    }<br>}<br><br>void setSDL2InputSemaphoreIndex(int semaIndex) {<br>    inited = 1;<br>    inputSemaphoreIndex = semaIndex;<br>
    setIoProcessEventsHandler(&amp;ioCheckForEvents);<br>}<br></blockquote><br></div>The only change needed for existing platform specific driver is to implement:<br>extern void setIoProcessEventsHandler(void * handler);</div>
<br></div>In Windows, I just had to add:<br><br><blockquote>/*sqWin32Window.c*/<br><br></blockquote></div><blockquote><div>/*Line 179*//**<br></div><div> * HACK: Hook for SDL2.<br> */<br>static void (*ioCheckForEventsHooks)(void);<br>
<br>EXPORT(void) setIoProcessEventsHandler(void * handler) {<br>    ioCheckForEventsHooks = (void (*)())handler;<br>}<br><br></div>/*Line 1586 */        /* HACK: for SDL2.*/<br>        if(ioCheckForEventsHooks)<br>            ioCheckForEventsHooks();<br>
</blockquote><div><br></div><div>I called them hacks, because a proper way means killing that code. As for the VM Windows code, it gives me the impression of being unnecessarily complex and to also have performance issues. In my laptop in Linux it takes about one minute to load NBOpenGL into a new image, but in Windows it takes about one hour, in the same machine.<br>
<br>It could be my impression, but is window using multiples thread, one for IO and another for the actual VM?<br><br></div><div>Greetings,<br>Ronie<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
2014-05-31 11:39 GMT-04:00 <a href="mailto:phil@highoctane.be">phil@highoctane.be</a> <span dir="ltr">&lt;<a href="mailto:phil@highoctane.be" target="_blank">phil@highoctane.be</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div><div dir="ltr"><div>Ronie,</div><div><br></div><div>Throw the VM sources somewhere so that I can try this on CentOS. Glibc 2_15 issue...</div><span class="HOEnZb"><font color="#888888"><div>
<br></div><div>Phil</div></font></span></div>

</div><div><div class="h5">
<br><br><div class="gmail_quote">On Sat, May 31, 2014 at 5:12 PM, Laurent Laffont <span dir="ltr">&lt;<a href="mailto:laurent.laffont@gmail.com" target="_blank">laurent.laffont@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<u></u>
<div style="font-family:&#39;Monospace&#39;;font-size:9pt;font-weight:400;font-style:normal">
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Hi,</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Seems to work well on my linux machine too (Arch 64). The main Pharo window is better handled by KDE (don&#39;t know why, but nice side effect :)</p>



<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Laurent</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Le samedi 31 mai 2014, 05:54:52 Ronie Salgado a écrit :</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; Hello There,</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; I have been working in OSWindow, which is a cross platform API for dealing</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; with native operating system windows. This API requires using a custom VM</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; and the library SDL2.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; With this API, even the main Pharo window is handled almost completely in</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; image side using NativeBoost.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; The only support required from the VM is a small periodical check in the</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; heartbeat about the presence of events. This no more than 10 lines of code.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; This is currently working very well in my Linux machine, so I need to start</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; testing this stuff.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; For Windows, soon I will be building the custom VM. My last built was very</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; dirty and I want to do something more clean.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; For Mac OS X, I don&#39;t have one for testing. But Alex is going allow me to</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; borrow one for some time. So be patience.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; As for Woden, it is a new 3D graphics engine that I started making. This</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; one requires currently support of OSWindow and also shows some cool stuffs.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; As for prebuilt versions of the VM with OSWindow support along with</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; preloaded images for both, OSWindow and Woden. And screenshots.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; Well, I am putting them here: <a href="http://ronie.cl/OSWindow/" target="_blank">http://ronie.cl/OSWindow/</a></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; Greetings,</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">&gt; Ronie</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>