comparison android/src/org/libsdl/app/SDL.java @ 1839:78abbabfd58d

Get Android build working again and update for SDL 2.0.7 (last version to support older versions of Android)
author Michael Pavone <pavone@retrodev.com>
date Sun, 14 Apr 2019 23:37:11 -0700
parents
children
comparison
equal deleted inserted replaced
1836:601ef72cc16f 1839:78abbabfd58d
1 package org.libsdl.app;
2
3 import android.content.Context;
4
5 /**
6 SDL library initialization
7 */
8 public class SDL {
9
10 // This function should be called first and sets up the native code
11 // so it can call into the Java classes
12 public static void setupJNI() {
13 SDLActivity.nativeSetupJNI();
14 SDLAudioManager.nativeSetupJNI();
15 SDLControllerManager.nativeSetupJNI();
16 }
17
18 // This function should be called each time the activity is started
19 public static void initialize() {
20 setContext(null);
21
22 SDLActivity.initialize();
23 SDLAudioManager.initialize();
24 SDLControllerManager.initialize();
25 }
26
27 // This function stores the current activity (SDL or not)
28 public static void setContext(Context context) {
29 mContext = context;
30 }
31
32 public static Context getContext() {
33 return mContext;
34 }
35
36 protected static Context mContext;
37 }