Back to project page Tilt-snake.
The source code is released under:
Apache License
If you think the Android project Tilt-snake listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/*The following code was borrowed from * http://developer.android.com/training/graphics/opengl/index.html * and modified to suit the needs of the application. * //w ww . j a v a 2 s. c om * * Copyright (C) 2011 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.awhittle.tiltsnake; import android.content.Context; import android.opengl.GLSurfaceView; /** * A view container where OpenGL ES graphics can be drawn on screen. * This view can also be used to capture touch events, such as a user * interacting with drawn objects. */ public class MyGLSurfaceView extends GLSurfaceView { private final MyGLRenderer mRenderer; public MyGLSurfaceView(Context context) { super(context); // Create an OpenGL ES 2.0 context. setEGLContextClientVersion(2); // Set the Renderer for drawing on the GLSurfaceView mRenderer = new MyGLRenderer(); setRenderer(mRenderer); // Render continuously setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY); } }