From 8fcfd85a69c4c8cdfec19f073efee397f892623d Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 2 Feb 2025 18:14:12 +0900 Subject: [PATCH] en/documents/steam: update --- contents/en/documents/steam.html | 7 +++---- contents/ja/documents/steam.html | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/contents/en/documents/steam.html b/contents/en/documents/steam.html index 1c4756f..5a2ca16 100644 --- a/contents/en/documents/steam.html +++ b/contents/en/documents/steam.html @@ -27,14 +27,13 @@

Steamworks SDK

Please note that this binding has not yet implemented most of the API. More features are planned for future updates.

Windows

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 GOOS and GOARCH.

-

There have been reports of an issue where Go applications freeze when running in the Windows Steam environment (#3181, golang/go#71242). As a workaround, please specify -ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1" when executing go build.

+

There have been reports of an issue where Go applications freeze when running in the Windows Steam environment (#3181, golang/go#71242). As a workaround, please specify -ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1" when executing go build. Additionally, in the steps below, the -H=windowsgui flag is added to prevent the console from opening at startup.

When building with PowerShell, it looks like this:

$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

When building in a POSIX shell, it looks like this:

-
env GOOS=windows GOARCH=amd64 go build -o yourgame_windows_amd64.exe -ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1" .
-

When building a GUI application for Windows, if you add -ldflags=-H=windowsgui, the initial console window will not appear. Although Ebitengine automatically closes the console, adding this flag will provide a better user experience.

+
env GOOS=windows GOARCH=amd64 go build -o yourgame_windows_amd64.exe -ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1 -H=windowsgui" .

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 ebiten.SetWindowIcon.

Once the exe file is created in this manner, compress it into a zip file and upload it to Steamworks as a build.

macOS

diff --git a/contents/ja/documents/steam.html b/contents/ja/documents/steam.html index cab8b05..22f08f8 100644 --- a/contents/ja/documents/steam.html +++ b/contents/ja/documents/steam.html @@ -27,14 +27,13 @@

Steamworks SDK

なおこのバインディングはまだ API をほとんど実装していません。今後対応予定です。

Windows

Windows は最も簡単で、普通に Go でビルドするだけです。 Ebitengine は Windows においては Pure Go なので、 GOOSGOARCH を指定すればどこでもビルドできます。

-

Go アプリケーションを Windows Steam 環境で動かすときに、フリーズすることがある問題が報告されています (#3181golang/go#71242)。ワークアラウンドとして、 go build を実行する際に -ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1" を指定してください。

+

Go アプリケーションを Windows Steam 環境で動かすときに、フリーズすることがある問題が報告されています (#3181golang/go#71242)。ワークアラウンドとして、 go build を実行する際に -ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1" を指定してください。なお、下記の手順では更に -H=windowsgui を追加して、最初にコンソールが開かないようにしています。

PowerShell でビルドする場合は次のようになります。

$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

POSIX シェルでビルドする場合は次のようになります。

-
env GOOS=windows GOARCH=amd64 go build -o yourgame_windows_amd64.exe -ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1" .
-

Windows 向け GUI アプリをビルドする際には -ldflags=-H=windowsgui をつけると、最初のコンソールの表示がなくなります。 Ebitengine の場合はコンソールを自動で閉じるので、つけなくても問題はありませんが、つけたほうがユーザー体験は良いでしょう。

+
env GOOS=windows GOARCH=amd64 go build -o yourgame_windows_amd64.exe -ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1 -H=windowsgui" .

アイコンは必須ではありません。気になる方はリソースを埋め込むツールを適宜使ってください。ゲーム実行中に ebiten.SetWindowIcon を呼ぶことで、タスクバーに表示されるアイコンを変更することはできます。

こうして出来上がった exe ファイルを zip で固めて、 Steamworks にビルドとしてアップロードしてください。

macOS