OpenGL ES SDK for Android ARM Developer Center
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ListEGLConfigs.java
Go to the documentation of this file.
1 /* Copyright (c) 2011-2017, ARM Limited and Contributors
2  *
3  * SPDX-License-Identifier: MIT
4  *
5  * Permission is hereby granted, free of charge,
6  * to any person obtaining a copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
9  * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
14  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19  */
20 
21 package com.arm.malideveloper.openglessdk.listeglconfigs;
22 
23 import javax.microedition.khronos.egl.EGLConfig;
24 import javax.microedition.khronos.opengles.GL10;
25 import android.content.Context;
26 import android.opengl.GLSurfaceView;
27 import android.os.Bundle;
28 import android.view.Window;
29 import android.view.WindowManager;
30 import com.arm.malideveloper.openglessdk.*;
31 
32 class ListEGLConfigsView extends MaliSamplesView
33 {
34  public ListEGLConfigsView(Context context)
35  {
36  super(context);
37  }
38 
39  @Override protected void setRendererCallback()
40  {
41  setRenderer(new Renderer());
42  }
43 
44  @Override protected void destroyContextCallback()
45  {
46  }
47 
48  protected class Renderer implements GLSurfaceView.Renderer
49  {
50  public void onDrawFrame(GL10 gl)
51  {
52  }
53 
54  public void onSurfaceChanged(GL10 gl, int width, int height)
55  {
56  ListEGLConfigs.init(width, height);
57  }
58 
59  public void onSurfaceCreated(GL10 gl, EGLConfig config)
60  {
61  }
62  }
63 };
64 
65 public class ListEGLConfigs extends MaliSamplesActivity
66 {
67  ListEGLConfigsView mView;
68 
69  public static native void init(int width, int height);
70  public static native void step();
71  public static native void uninit();
72 
73  @Override protected void onCreate(Bundle savedInstanceState)
74  {
75  super.onCreate(savedInstanceState);
76 
77  this.requestWindowFeature(Window.FEATURE_NO_TITLE);
78  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
79  WindowManager.LayoutParams.FLAG_FULLSCREEN);
80 
81  mView = new ListEGLConfigsView(getApplication());
82  setContentView(mView);
83  }
84 
85  @Override protected void onPause()
86  {
87  super.onPause();
88  mView.onPause();
89  }
90 
91  @Override protected void onResume()
92  {
93  super.onResume();
94  mView.onResume();
95  }
96 
97  @Override protected void onDestroy()
98  {
99  super.onDestroy();
100  }
101 
102  static
103  {
104  // Load the NDK library for this example, built with ndk-build
105  System.loadLibrary("Native");
106  }
107 }
108 
109 
GLint GLsizei GLsizei height
Definition: gl2ext.h:179
static native void init(int width, int height)
GLint GLsizei width
Definition: gl2ext.h:179