-
Notifications
You must be signed in to change notification settings - Fork 3
Getting Started (for Linux users)
- Use your distribution package manager to install
vala, sdl2, sdl2_image, sdl2_mixer, sdl2_gfx, sdl2_net, sdl2_ttf, chipmunk
- Make sure to install chipmunk version 6.2.0 or higher.
-
Clone or download and extract SDL2 VAPIs to any place you want.
git clone https://git.gitorious.org/sdl-2-0-vala-vapi/pedrohlc-sdl2-vala-vapi.git
-
Open a terminal in the extracted folder and then run:
sudo ./INSTALL
- (After this you can delete this folder as it won't be longer necessary)
-
Clone or download and extract our repository on any place you want.
-
Open a terminal inside "avalanche/sdks/vapi" and then run:
sudo ./INSTALL
-
Copy "avalanche/sdks/template" to anywhere you want, feel free to rename it to any desired name, in this new folder your project will be developed.
-
Inside yours project folder, create a bash file to keep your environment variables, something similar to this:
#!/bin/sh export AVALANCHE_DIR="/home/pedrohlc/Projects/avalanche" make $*
- For more variable options and documentation, check page "Default Makefile environment variables" on our wiki.
- When you're ready open a terminal and run your new bash file.
- Use your distribution package manager to install
vala, mingw-w64-glib2, mingw-w64-sdl2, mingw-w64-sdl2_image, mingw-w64-sdl2_mixer, mingw-w64-sdl2_gfx, mingw-w64-sdl2_net, mingw-w64-sdl2_ttf, mingw-w64-chipmunk, mingw-w64-libgee
- (Check "Useful files" on our wiki for pre-built packages if necessary)
- Inside yours project folder, create a bash file to keep your environment variables, something similar to this:
#!/bin/sh export CROSS=MINGW export AVALANCHE_DIR="/home/pedrohlc/Projects/avalanche" make $*
- For more variable options and documentation, check page "Default Makefile environment variables" on our wiki.
- For running you're gonna need to copy the following files into project's "bin" folder:
libbz2-1.dll, libffi-6.dll, libfreetype-6.dll, libgcc_s_sjlj-1.dll, libgee-0.8.dll, libglib-2.0-0.dll, libgobject-2.0-0.dll, libiconv-2.dll, libintl-8.dll, libpng16-16.dll, libSDL2_gfx-1-0-0.dll, libstdc++-6.dll, libwinpthread-1.dll, SDL2.dll, SDL2_image.dll, SDL2_mixer.dll, SDL2_net.dll, SDL2_ttf.dll, smpeg2.dll, zlib1.dll
You're gonna need to know how to create an Android project in Eclise and how to insert a library into it.
-
Use your distribution package manager to install
vala
-
Choose, download and extract anywhere one of ours Android Toolchain, available here.
-
Inside yours project folder, create a bash file to keep your environment variables, something similar to this:
#!/bin/sh export CROSS=ANDROID export ANDROID_TOOLCHAIN="/home/pedrohlc/Projects/my_android_toolchain" export AVALANCHE_DIR="/home/pedrohlc/Projects/avalanche" make $*
- For more variable options and documentation, check page "Default Makefile environment variables" on our wiki.
- When you're ready open a terminal and run your new bash file. A new file with name "./bin/libgame-android.so" will be created in folder "bin".
- You can also "strip" this file to reduce it size. (Better use toolchain's "strip")
-
Create a new Android Project in Eclipse, add "SDLActivity.java" (available on SDL2's source) to your sources (keep it's package hierarchy), make your main activity extend this new class by changing this line:
public class MainActivity extends SDLActivity {
-
Edit "SDLActivity.java" static lib loading to look this way:
// Load the .so static { System.loadLibrary("game-android"); }
-
Copy any file inside original project "res" folder (images, sounds, fonts) to folder "assets" in Android project.
-
Copy "libgame-android.so" to folder "libs/armeabi/" (depending in the processor architecture you're targetting, instead of "armeabi" it can be others names) in your Android project.
-
You probably will find interesting changing this options in "AndroidManifest.xml":
- Allow assets to be installed/moved to sdcard, add in "manifest" tag:
android:installLocation="preferExternal"
- Running game in fullscreen, add in "application" tag:
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
- Preventing crash when rotating screen or opening a keyboard, add in "activity" tag:
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"