<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><font face="Menlo-Regular" class=""><span style="font-size: 11px;" class="">ok. reposted the question again here.</span></font></div><div class=""><font face="Menlo-Regular" class=""><span style="font-size: 11px;" class=""><br class=""></span></font></div><div class=""><font face="Menlo-Regular" class=""><span style="font-size: 11px;" class="">=======</span></font><span style="font-family: Menlo-Regular; font-size: 11px;" class="">=======</span><span style="font-family: Menlo-Regular; font-size: 11px;" class="">=======</span><span style="font-family: Menlo-Regular; font-size: 11px;" class="">=======</span><span style="font-family: Menlo-Regular; font-size: 11px;" class="">=======</span></div><span style="font-family: Menlo-Regular; font-size: 11px;" class=""><div class=""><span style="font-family: Menlo-Regular; font-size: 11px;" class=""><br class=""></span></div>Finally got a context open and working. Next things:</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px;" class="">1) what’s the best way to handle long strings? in JS they’ll loading text from divs but i’d rather do that from a file since long strings in Pascal aren’t great. How does that work?</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px;" class="">2) what’s the deal with arrays? I saw there is array of xxx syntax for dynamic arrays. Can we use static arrays also and do they work with new Float32Array(xxx)? I guess all JS arrays are the same and I can pass them like</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px;" class="">3) how does the syntax “new Float32Array()” translate to Pascal? There’s no generic class allocator syntax in Pascal so what do we use?</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px;" class="">4) in functions from webgl that return strings the type is “JSValue”. How do those work with “string” in Pascal now? Maybe just typecast to string?</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px;" class="">====</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px;" class="">uses BrowserConsole, Web, WebGL;</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px;" class="">const</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 11px; white-space: pre;">   </span><span style="font-family: Menlo-Regular; font-size: 11px;" class="">kWidth = 100;</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 11px; white-space: pre;"> </span><span style="font-family: Menlo-Regular; font-size: 11px;" class="">kHeight = 100;</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px;" class="">var</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px;" class=""> canvas: TJSHTMLCanvasElement;</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px;" class=""> gl: TJSWebGLRenderingContext;</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px;" class="">begin</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px;" class=""> canvas := TJSHTMLCanvasElement(document.createElement('canvas'));</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px;" class=""> canvas.width := kWidth;</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px;" class=""> canvas.height := kHeight;</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 11px; white-space: pre;">  </span><span style="font-family: Menlo-Regular; font-size: 11px;" class="">document.body.appendChild(canvas);</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 11px; white-space: pre;">        </span><span style="font-family: Menlo-Regular; font-size: 11px;" class="">gl := TJSWebGLRenderingContext(canvas.getContext('webgl'));</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 11px; white-space: pre;">   </span><span style="font-family: Menlo-Regular; font-size: 11px;" class="">if gl = nil then</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 11px; white-space: pre;">      </span><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 11px; white-space: pre;">     </span><span style="font-family: Menlo-Regular; font-size: 11px;" class="">begin</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 11px; white-space: pre;"> </span><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 11px; white-space: pre;">     </span><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 11px; white-space: pre;">     </span><span style="font-family: Menlo-Regular; font-size: 11px;" class="">writeln('failed to load webgl!');</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 11px; white-space: pre;">     </span><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 11px; white-space: pre;">     </span><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 11px; white-space: pre;">     </span><span style="font-family: Menlo-Regular; font-size: 11px;" class="">exit;</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 11px; white-space: pre;"> </span><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 11px; white-space: pre;">     </span><span style="font-family: Menlo-Regular; font-size: 11px;" class="">end;</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 11px; white-space: pre;">  </span><span style="font-family: Menlo-Regular; font-size: 11px;" class="">gl.clearColor(1, 0, 0, 1);</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 11px; white-space: pre;">    </span><span style="font-family: Menlo-Regular; font-size: 11px;" class="">gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 11px; white-space: pre;">     </span><span style="font-family: Menlo-Regular; font-size: 11px;" class="">gl.clear(gl.COLOR_BUFFER_BIT);</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px;" class="">end.</span><br class=""><div class="">
<span class="Apple-style-span" style="border-collapse: separate; font-family: Verdana; font-variant-ligatures: normal; font-variant-east-asian: normal; font-variant-position: normal; line-height: normal; border-spacing: 0px; -webkit-text-decorations-in-effect: none;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Regards,<br class=""><span class="Apple-tab-span" style="white-space: pre;">    </span>Ryan Joseph<br class=""></div></span>

</div>
<br class=""></body></html>