Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Compilation requires a C compiler like GCC to compile third party libraries used by Ebiten. You would need C compiler like MinGW on Windows. Visual Studio is not tested.
Ebiten is also tested on Windows Subsystem for Linux. Don't forget to install MinGW and add
GOOS=windows when building.
How to install
Option 1. Git official
You can get the official installer. Git is required before
Add the below values to
PATH environment variable:
- For 32bit,
- For 64bit,
C:\Program Files (x86)\Git\bin
Option 2. Scoop
You also can get Git via Scoop.
scoop install git
Install C compiler
A C compiler is also required before
go get. There are some options.
Option 1. MinGW official
Get the installer from MinGW (or MinGW-w64 for 64bit Windows) and install it, then set
PATH environment variable. It might be hard to find where to download the installer, and in this case, using scoops would be a good option.
Option 2. Scoop
You also can get MinGW via Scoop. This is the easiest way.
scoop install gcc
Option 3. TDM GCC
Get the installer from TDM GCC and install it.
PATH will be set by the install so you don't have to care. The problem is that TDM GCC is not updated recently, and the last update was in 2015.
To check installation finished correctly, let's execute an example.
cd %GOPATH%\src\github.com\hajimehoshi\ebiten\examples go run -tags=example rotate\main.go
Windows Subsystem for Linux
- Install 'Windows for Subsystem for Linux (https://docs.microsoft.com/en-us/windows/wsl/install-win10)
- Install 'Ubuntu' via Windows Store
In the Ubuntu:
- Set up (add a new user)
sudo apt update
sudo apt upgrade
sudo apt install mingw-w64
- Install Linux 'Go' downloaded from https://golang.org (Linux version is required. The download directory is typically
If you use go modules, that's done! Ebiten will be downloaded automatically if your lib depends on Ebiten. For example:
mkdir test cd test go mod init example.com/m # When cross-compiling, cgo is disabled by default. CC=x86_64-w64-mingw32-gcc CGO_ENABLED=1 GOOS=windows go get github.com/hajimehoshi/ebiten@master CC=x86_64-w64-mingw32-gcc CGO_ENABLED=1 GOOS=windows go build -tags=example github.com/hajimehoshi/ebiten/examples/rotate
rotate.exe to somewhere and open this from Windows.
If you don't, let's go-get:
GO111MODULE=off go get -u github.com/hajimehoshi/ebiten/...
It is possible to cross-compile Ebiten games for windows, see: Cross Compiling