1 /* 2 * Copyright 2018 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 17 package com.google.oboe.samples.rhythmgame; 18 19 import android.opengl.GLSurfaceView; 20 import javax.microedition.khronos.egl.EGLConfig; 21 import javax.microedition.khronos.opengles.GL10; 22 23 public class RendererWrapper implements GLSurfaceView.Renderer { native_onSurfaceCreated()24 public static native void native_onSurfaceCreated(); native_onSurfaceChanged(int widthInPixels, int heightInPixels)25 public static native void native_onSurfaceChanged(int widthInPixels, int heightInPixels); native_onDrawFrame()26 public static native void native_onDrawFrame(); 27 @Override onSurfaceCreated(GL10 gl10, EGLConfig eglConfig)28 public void onSurfaceCreated(GL10 gl10, EGLConfig eglConfig) { 29 native_onSurfaceCreated(); 30 } 31 32 @Override onSurfaceChanged(GL10 gl10, int width, int height)33 public void onSurfaceChanged(GL10 gl10, int width, int height) { 34 native_onSurfaceChanged(width, height); 35 } 36 37 @Override onDrawFrame(GL10 gl10)38 public void onDrawFrame(GL10 gl10) { 39 native_onDrawFrame(); 40 } 41 } 42