<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/crawshaw/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/crawshaw">@crawshaw</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/hyangah/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/hyangah">@hyangah</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/rakyll/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/rakyll">@rakyll</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nigeltao/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nigeltao">@nigeltao</a><br>
As Go is high-performant system-level programming language, that also gained fast garbage collector in latest 1.5 release, it can become a perfect choice for game development. There are many OpenGL ES 2 emulation layers for Windows, for example Google's open-source <a href="code.google.com/p/angleproject/">ANGLE</a>, <a href="http://developer.amd.com/tools-and-sdks/graphics-development/amd-opengl-es-sdk/" rel="nofollow">AMD library</a> and others. It would be great if <code class="notranslate">golang.org/x/mobile/...</code> packages were implemented for this OS aside of Mac OS X, as it is probably most popular operating system among game developers. This would be big step to Go promotion, because it would enable large gamedev community to easily develop (cross-platform) games in Go.</p>
<p dir="auto">Yes, now one can build apps and launch them on real device, but such workflow is unusable because of very long build time (compile -&gt; zip -&gt; sign -&gt; upload to device -&gt; wait until installation complete). All game engines and frameworks use this scheme with desktop emulation.</p>
<p dir="auto">I personally ask for this because I chose Go as language for developing my Android game, but after investigation I decided to work on my own OpenGL binding and other mobile code. Hope this will be considered. Thanks</p>
<p dir="auto">The <a href="http://golang.org/x/mobile/app" rel="nofollow">http://golang.org/x/mobile/app</a> package lets you run all-Go apps on desktop darwin and linux with nothing more than the stock Go build. Just <code class="notranslate">go get</code> and you're programming. This is done via cgo: we ask for a window, get an OpenGL context, and map mouse events to touch events.</p>
<p dir="auto">We should do the same for Windows. There are a few complications.</p>
<p dir="auto">The first is by default there is C compiler for cgo on windows. On both linux and OS X we can rely on the user to install gcc/xcode because the platform makes it easy. By comparison MinGW is an extra, non-obvious step for windows users and VC++ isn't supported (and not necessarily any more obvious).</p>
<p dir="auto">The second is there is no OpenGL. Well, there is kinda, as provided by graphics card makers, but support in particular for OpenGL ES 2 and EGL is spotty. Luckily, Chrome has this problem too and maintain an open source project implementing ES 2 and EGL for Windows on top of DirectX: <a href="https://code.google.com/p/angleproject/" rel="nofollow">https://code.google.com/p/angleproject/</a></p>
<p dir="auto">I want to avoid importing angleproject directly into the mobile repository as it has several licenses and I want to keep the notices story for the Go repository simple. So we will need another repository that contains a package that links against angleproject and creates the window.</p>
<p dir="auto">Is there any way about needing windows users to install a C compiler? Can we ship a binary .dll in a repository that is downloaded with go get? If we do, what about the cgo parts of <code class="notranslate">mobile/app</code> and <code class="notranslate">mobile/gl</code>? Can they be provided by the .dll even if we fetch it as part of a different repository? For <code class="notranslate">mobile/app</code> probably, but <code class="notranslate">mobile/gl</code> is harder.</p>