Skip to content

Getting Started

Marcus Renno edited this page Aug 10, 2018 · 1 revision

Requirements

  • Go: https://golang.org/dl/

  • Enable CGO with export CGO_ENABLED=1

  • SDL2 - the instructions below were taken from https://github.com/veandco/go-sdl2

    • On Ubuntu 14.04 and above, type:
      apt install libsdl2{,-image,-mixer,-ttf,-gfx}-dev

    • On Fedora 25 and above, type:
      yum install SDL2{,_image,_mixer,_ttf,_gfx}-devel

    • On Arch Linux, type:
      pacman -S sdl2{,_image,_mixer,_ttf,_gfx}

    • On Gentoo, type:
      emerge -av libsdl2 sdl2-{image,mixer,ttf,gfx}

    • On macOS, install SDL2 via Homebrew like so:
      brew install sdl2{,_image,_mixer,_ttf,_gfx} pkg-config

    • On Windows,

      1. Install mingw-w64 from Mingw-builds
      • Version: latest (at time of writing 6.3.0)
      • Architecture: x86_64
      • Threads: win32
      • Exception: seh
      • Build revision: 1
      • Destination Folder: Select a folder that your Windows user owns
      1. Install SDL2 http://libsdl.org/download-2.0.php
      • Extract the SDL2 folder from the archive using a tool like 7zip
      • Inside the folder, copy the i686-w64-mingw32 and/or x86_64-w64-mingw32 depending on the architecture you chose into your mingw-w64 folder e.g. C:\Program Files\mingw-w64\x86_64-6.3.0-win32-seh-rt_v5-rev1\mingw64
      1. Setup Path environment variable
      • Put your mingw-w64 binaries location into your system Path environment variable. e.g. C:\Program Files\mingw-w64\x86_64-6.3.0-win32-seh-rt_v5-rev1\mingw64\bin and C:\Program Files\mingw-w64\x86_64-6.3.0-win32-seh-rt_v5-rev1\mingw64\x86_64-w64-mingw32\bin
      1. Open up a terminal such as Git Bash and run go get -v github.com/veandco/go-sdl2/sdl.
      2. (Optional) You can repeat Step 2 for SDL_image, SDL_mixer, SDL_ttf
      • NOTE: pre-build the libraries for faster compilation by running go install github.com/veandco/go-sdl2/{sdl,img,mix,ttf}
    • Or you can install SDL2 via Msys2 like so: pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2{,_image,_mixer,_ttf,_gfx}

Installation

Now that you have all the requirements, installing Macaw is as easy as any other Go project. Just execute

go get github.com/tubelz/macaw

And you should be able to start creating your game!

Troubleshooting

You can use the flag -v in the go get command to see the error you are getting in details

Updating Macaw

To update all you have do is run

go get -u github.com/tubelz/macaw

Clone this wiki locally