<div><br></div><div>&quot;<span class="Apple-style-span" style="font-family: monospace; font-size: 12px; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">is there some relatively simple way </span><span class="Apple-style-span" style="font-family: monospace; font-size: 12px; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">in Squeak to direct OGL drawing to a morphic surface/canvas/thingie so </span><span class="Apple-style-span" style="font-family: monospace; font-size: 12px; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">it renders inside the boundaries of the morph when moved?&quot;</span></div>
<div><span class="Apple-style-span" style="font-family: monospace; font-size: 12px; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><br></span></div><div><font class="Apple-style-span" face="monospace" size="3"><span class="Apple-style-span" style="font-size: 12px; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">Download OpenCobalt. Take the code below and load it into that image to create the class. Then go to CobaltWorldIntro&gt;&gt;initialize and add: </span></font></div>
<div><font class="Apple-style-span" face="monospace" size="3"><span class="Apple-style-span" style="font-size: 12px; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><br></span></font></div>
<div><font class="Apple-style-span" face="monospace" size="3"><span class="Apple-style-span" style="font-size: 12px; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><div>yum := TOglTestTriangle new.</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>space addChild: yum.</div><div><br></div><div>When you go to CobaltWorldIntro (which isn&#39;t the default) you&#39;ll wander around and see a triangle. That OpenGL code is straight out of an OpenGL book. The window will be easy to pick up and move around the greater Squeak World. I don&#39;t think it uses Morphic, but a fusion of MVC and Morphic called Tweak.  </div>
<div><br></div><div>Chris</div><div> </div></span></font></div><div><br></div><div><div>TFrame subclass: #TOglTestTriangle</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>instanceVariableNames: &#39;&#39;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>classVariableNames: &#39;&#39;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>poolDictionaries: &#39;&#39;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>category: &#39;OpenCobalt-OpenGL-Test&#39;!</div>
<div><br></div><div>!TOglTestTriangle methodsFor: &#39;render&#39; stamp: &#39;jrd 3/13/2010 17:33&#39;!</div><div>render: ogl</div><div><br></div><div>       ogl glBegin(GLTriangles).</div><div>       ogl glVertex3f(2.0, 2.5, -1.0).</div>
<div>       ogl glVertex3f(-3.5, -2.5, -1.0).</div><div>       ogl glVertex3f(2.0, -4.0, -1.0).</div><div>       ogl glEnd().</div><div>! !</div></div><div><br></div>