Skip to content

Commit

Permalink
en/documents/steam: update
Browse files Browse the repository at this point in the history
  • Loading branch information
hajimehoshi committed Feb 2, 2025
1 parent 0ed302d commit 8fcfd85
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions contents/en/documents/steam.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ <h2>Steamworks SDK</h2>
<p>Please note that this binding has not yet implemented most of the API. More features are planned for future updates.</p>
<h2>Windows</h2>
<p>Windows is the simplest case, where you just build with Go normally. Since Ebitengine is Pure Go on Windows, you can build it anywhere by specifying <code>GOOS</code> and <code>GOARCH</code>.</p>
<p>There have been reports of an issue where Go applications freeze when running in the Windows Steam environment (<a href="https://github.com/hajimehoshi/ebiten/issues/3181">#3181</a>, <a href="https://github.com/golang/go/issues/71242">golang/go#71242</a>). As a workaround, please specify <code>-ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1"</code> when executing <code>go build</code>.</p>
<p>There have been reports of an issue where Go applications freeze when running in the Windows Steam environment (<a href="https://github.com/hajimehoshi/ebiten/issues/3181">#3181</a>, <a href="https://github.com/golang/go/issues/71242">golang/go#71242</a>). As a workaround, please specify <code>-ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1"</code> when executing <code>go build</code>. Additionally, in the steps below, the <code>-H=windowsgui</code> flag is added to prevent the console from opening at startup.</p>
<p>When building with PowerShell, it looks like this:</p>
<pre><code>$Env:GOARCH = 'amd64'
go build -o yourgame_windows_amd64.exe -ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1" .
go build -o yourgame_windows_amd64.exe -ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1 -H=windowsgui" .
Remove-Item Env:GOARCH</code></pre>
<p>When building in a POSIX shell, it looks like this:</p>
<pre><code>env GOOS=windows GOARCH=amd64 go build -o yourgame_windows_amd64.exe -ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1" .</code></pre>
<p>When building a GUI application for Windows, if you add <code>-ldflags=-H=windowsgui</code>, the initial console window will not appear. Although Ebitengine automatically closes the console, adding this flag will provide a better user experience.</p>
<pre><code>env GOOS=windows GOARCH=amd64 go build -o yourgame_windows_amd64.exe -ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1 -H=windowsgui" .</code></pre>
<p>Icons are not mandatory. If you wish, use a resource embedding tool as appropriate. During game execution, you can change the icon displayed in the taskbar by calling <a href="https://pkg.go.dev/github.com/hajimehoshi/ebiten/v2#SetWindowIcon"><code>ebiten.SetWindowIcon</code></a>.</p>
<p>Once the <code>exe</code> file is created in this manner, compress it into a zip file and upload it to Steamworks as a build.</p>
<h2>macOS</h2>
Expand Down
7 changes: 3 additions & 4 deletions contents/ja/documents/steam.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ <h2>Steamworks SDK</h2>
<p>なおこのバインディングはまだ API をほとんど実装していません。今後対応予定です。</p>
<h2>Windows</h2>
<p>Windows は最も簡単で、普通に Go でビルドするだけです。 Ebitengine は Windows においては Pure Go なので、 <code>GOOS</code><code>GOARCH</code> を指定すればどこでもビルドできます。</p>
<p>Go アプリケーションを Windows Steam 環境で動かすときに、フリーズすることがある問題が報告されています (<a href="https://github.com/hajimehoshi/ebiten/issues/3181">#3181</a><a href="https://github.com/golang/go/issues/71242">golang/go#71242</a>)。ワークアラウンドとして、 <code>go build</code> を実行する際に <code>-ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1"</code> を指定してください。</p>
<p>Go アプリケーションを Windows Steam 環境で動かすときに、フリーズすることがある問題が報告されています (<a href="https://github.com/hajimehoshi/ebiten/issues/3181">#3181</a><a href="https://github.com/golang/go/issues/71242">golang/go#71242</a>)。ワークアラウンドとして、 <code>go build</code> を実行する際に <code>-ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1"</code> を指定してください。なお、下記の手順では更に <code>-H=windowsgui</code> を追加して、最初にコンソールが開かないようにしています。</p>
<p>PowerShell でビルドする場合は次のようになります。</p>
<pre><code>$Env:GOARCH = 'amd64'
go build -o yourgame_windows_amd64.exe -ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1" .
go build -o yourgame_windows_amd64.exe -ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1 -H=windowsgui" .
Remove-Item Env:GOARCH</code></pre>
<p>POSIX シェルでビルドする場合は次のようになります。</p>
<pre><code>env GOOS=windows GOARCH=amd64 go build -o yourgame_windows_amd64.exe -ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1" .</code></pre>
<p>Windows 向け GUI アプリをビルドする際には <code>-ldflags=-H=windowsgui</code> をつけると、最初のコンソールの表示がなくなります。 Ebitengine の場合はコンソールを自動で閉じるので、つけなくても問題はありませんが、つけたほうがユーザー体験は良いでしょう。</p>
<pre><code>env GOOS=windows GOARCH=amd64 go build -o yourgame_windows_amd64.exe -ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1 -H=windowsgui" .</code></pre>
<p>アイコンは必須ではありません。気になる方はリソースを埋め込むツールを適宜使ってください。ゲーム実行中に <a href="https://pkg.go.dev/github.com/hajimehoshi/ebiten/v2#SetWindowIcon"><code>ebiten.SetWindowIcon</code></a> を呼ぶことで、タスクバーに表示されるアイコンを変更することはできます。</p>
<p>こうして出来上がった <code>exe</code> ファイルを zip で固めて、 Steamworks にビルドとしてアップロードしてください。</p>
<h2>macOS</h2>
Expand Down

0 comments on commit 8fcfd85

Please sign in to comment.