comparison android/src/org/libsdl/app/SDL.java @ 1840:3d0b20e9a187

Merge
author Michael Pavone <pavone@retrodev.com>
date Thu, 18 Apr 2019 19:48:04 -0700
parents 78abbabfd58d
children
comparison
equal deleted inserted replaced
1838:0c1491818f4b 1840:3d0b20e9a187
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 }