Create a simple Hello World example app with Gi.
On all platforms, you must download and install Go from the Go website if you do not already have Go 1.18+ installed.
- Install the xcode command-line tools if you don’t already have them by running
- If you don’t already have the Vulkan SDK installed, install it by doing the following:
curl -O https://sdk.lunarg.com/sdk/download/latest/mac/vulkan_sdk.dmg
- Double click
- Follow the installation prompts and ignore all warnings about the Vulkan Portability Enumeration extension
- Download and install Git for Windows from the git website if you don’t already have it. You should install Git Bash as part of this process and use it for development.
- Download and install TDM-GCC from this website
- Open Windows Command Prompt and run
- Then, run
- If you are on Ubuntu or Debian, run
sudo apt-get install libgl1-mesa-dev xorg-dev
- If you are on CentOS or Fedora, run
sudo dnf install libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel mesa-libGL-devel libXi-devel libXxf86vm-devel
Clone the Gi repository by running
git clone https://github.com/goki/gi
Try it out!
- Navigate to the widgets example by running
- Build the widgets example by running
- Run the widgets example by running
./widgetsif you are on MacOS or Linux and
./widgets.exeif you are on Windows. This should create a window with a variety of widgets, similar to the screenshot below:
Extend the Hello World example to support incrementing a number by clicking on a button.
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.