-
-
Notifications
You must be signed in to change notification settings - Fork 227
Getting Started
Before we can start using go-sdl2, we need to install the native version of SDL2.
On Linux, most of the popular distributions have SDL2 in their package repository. The following describes a command that can install SDL2 on specific Linux distributions. Note: some older distributions may be missing some if not all of the SDL2 packages. In that case, we may install SDL2 by compiling the source which will be described below.
dnf install SDL2{,_image,_mixer,_ttf,_gfx}-devel
pacman -S sdl2{,_image,_mixer,_ttf,_gfx}
apt-get install libsdl2{,-image,-mixer,-ttf,-gfx}-dev
TODO
TODO
After we installed SDL2, we can proceed to installing go-sdl2.
You can install go-sdl2 by running the following command:
go get -v github.com/veandco/go-sdl2/sdl
Now to see if everything was installed correctly, let's try running one of the examples. Go to go-sdl2's examples/gfx
directory and run:
go run gfx.go
If it manages to launch a window without a compile&runtime errors, that means you have installed go-sdl2 successfully and ready to create your own go-sdl2 programs!
TODO (suggestion): Lesson 2: Creating & handling window. Lesson 3: Basic shapes (circle, rect, etc)