GithubHelp home page GithubHelp logo

bbert819 / go-sdl2-android-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gen2brain/go-sdl2-android-example

0.0 1.0 0.0 701 KB

Go-SDL2 example running on Android

License: GNU General Public License v3.0

Shell 7.12% Makefile 1.32% Java 83.09% C 0.13% Go 8.35%

go-sdl2-android-example's Introduction

Go-SDL2 Android Example

Go-SDL2 example running on Android.

Golang example is compiled to C shared library and then linked with the help of Android.mk files from SDL2.

SDLActivity.java is used, same as with C/C++ and SDL2.

Download APK

go-sdl2-example-debug.apk

Compile

To compile example you will need Android NDK and Android SDK , download and unpack archives somewhere.

Go toolchain must be cross compiled for android/arm. There is a bootstrap script you can use to compile toolchain and SDL2. Make sure you have mercurial/hg, curl and ant installed.

ANDROID_NDK=/opt/android-ndk ./bootstrap.bash /usr/local

Point ANDROID_NDK to directory where you unpacked archive, /usr/local is prefix where Go and android toolchains will be installed.

After build is complete you must first compile example to shared library, GOROOT needs to point to toolchain that we compiled for android:

cd example
ANDROID_TOOLCHAIN=/usr/local/android-toolchain-arm GOROOT=/usr/local/go ./make.bash

And to build apk:

cd android
ANDROID_NDK=/opt/android-ndk ANDROID_SDK=/opt/android-sdk ./make.bash

If everything is successfully built apk can be found in android/bin directory.

go-sdl2-android-example's People

Contributors

gen2brain avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.