19bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich/*
29bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich * Copyright (C) 2007 The Android Open Source Project
39bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich *
49bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich * Licensed under the Apache License, Version 2.0 (the "License");
59bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich * you may not use this file except in compliance with the License.
69bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich * You may obtain a copy of the License at
79bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich *
89bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich *      http://www.apache.org/licenses/LICENSE-2.0
99bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich *
109bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich * Unless required by applicable law or agreed to in writing, software
119bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich * distributed under the License is distributed on an "AS IS" BASIS,
129bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
139bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich * See the License for the specific language governing permissions and
149bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich * limitations under the License.
159bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich */
169bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich
179bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevichpackage com.android.gldual;
189bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich
199bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevichimport android.app.Activity;
209bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevichimport android.content.Context;
219bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevichimport android.opengl.GLSurfaceView;
229bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevichimport android.os.Bundle;
239bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevichimport android.view.View;
249bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevichimport android.widget.LinearLayout;
259bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich
269bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich
279bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevichpublic class GLDualActivity extends Activity {
289bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich
299bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich    GLSurfaceView mGLView;
309bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich    GLDualGL2View mGL2View;
319bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich
329bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich    @Override protected void onCreate(Bundle icicle) {
339bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich        super.onCreate(icicle);
349bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich        View root = getLayoutInflater().inflate(R.layout.gldual_activity, null);
359bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich        mGLView = (GLSurfaceView) root.findViewById(R.id.gl1);
36d594fe1740581031c527e1e6a098024abea90429Jack Palevich        mGLView.setEGLConfigChooser(5,6,5,0,0,0);
379bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich        mGLView.setRenderer(new TriangleRenderer());
389bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich        mGL2View = (GLDualGL2View) root.findViewById(R.id.gl2);
399bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich        setContentView(root);
409bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich    }
419bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich
429bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich    @Override protected void onPause() {
439bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich        super.onPause();
449bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich        mGLView.onPause();
459bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich        mGL2View.onPause();
469bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich    }
479bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich
489bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich    @Override protected void onResume() {
499bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich        super.onResume();
509bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich        mGLView.onResume();
519bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich        mGL2View.onResume();
529bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich    }
539bd30f05e890b213e97b838e04024d8cd232dbc0Jack Palevich}
54