FountainFbo.java revision e5f2f66f8c802d64ecf869081036ae13d4e9e19c
1/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.example.android.rs.fountainfbo;
18
19import android.app.Activity;
20import android.os.Bundle;
21import android.util.Log;
22
23public class FountainFbo extends Activity {
24    private static final String LOG_TAG = "libRS_jni";
25    private static final boolean DEBUG  = false;
26    private static final boolean LOG_ENABLED = false;
27
28    private FountainFboView mView;
29
30    @Override
31    public void onCreate(Bundle icicle) {
32        super.onCreate(icicle);
33
34        /* Create our Preview view and set it as the content of our Activity */
35        mView = new FountainFboView(this);
36        setContentView(mView);
37    }
38
39    @Override
40    protected void onResume() {
41        Log.e("rs", "onResume");
42
43        /* Ideally a game should implement onResume() and onPause()
44         to take appropriate action when the activity loses focus */
45        super.onResume();
46        mView.resume();
47    }
48
49    @Override
50    protected void onPause() {
51        Log.e("rs", "onPause");
52
53        /* Ideally a game should implement onResume() and onPause()
54        to take appropriate action when the activity loses focus */
55        super.onPause();
56        mView.pause();
57    }
58
59    static void log(String message) {
60        if (LOG_ENABLED) {
61            Log.v(LOG_TAG, message);
62        }
63    }
64}
65
66