blob: cd730aa95b21e5681f3920229c1b5539eaa2aebf [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001**
2** Copyright 2006, 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// This source file is automatically generated
18
19package com.google.android.gles_jni;
20
Elliott Hughes24ce5fb2011-04-08 20:01:01 -070021import android.app.AppGlobals;
Jack Palevich91a27ae2009-06-15 21:03:24 -070022import android.content.pm.ApplicationInfo;
23import android.content.pm.IPackageManager;
24import android.os.Build;
25import android.util.Log;
26
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080027import java.nio.Buffer;
28import javax.microedition.khronos.opengles.GL10;
29import javax.microedition.khronos.opengles.GL10Ext;
30import javax.microedition.khronos.opengles.GL11;
31import javax.microedition.khronos.opengles.GL11Ext;
32import javax.microedition.khronos.opengles.GL11ExtensionPack;
33
34public class GLImpl implements GL10, GL10Ext, GL11, GL11Ext, GL11ExtensionPack {
35
36 // Private accessors for native code
37
38 native private static void _nativeClassInit();
39 static {
40 _nativeClassInit();
41 }
42
43 Buffer _colorPointer = null;
44 Buffer _normalPointer = null;
45 Buffer _texCoordPointer = null;
46 Buffer _vertexPointer = null;
Jack Palevichbe6eac82009-12-08 15:43:51 +080047 Buffer _pointSizePointerOES = null;
48 Buffer _matrixIndexPointerOES = null;
49 Buffer _weightPointerOES = null;
Jack Palevich8a4de4b2010-01-28 20:28:32 +080050
51 private boolean haveCheckedExtensions;
52 private boolean have_OES_blend_equation_separate;
53 private boolean have_OES_blend_subtract;
54 private boolean have_OES_framebuffer_object;
55 private boolean have_OES_texture_cube_map;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080056
57 public GLImpl() {
58 }
59
Jack Palevich91a27ae2009-06-15 21:03:24 -070060 public void glGetPointerv(int pname, java.nio.Buffer[] params) {
61 throw new UnsupportedOperationException("glGetPointerv");
62 }
63
64 private static boolean allowIndirectBuffers(String appName) {
65 boolean result = false;
66 int version = 0;
Elliott Hughes24ce5fb2011-04-08 20:01:01 -070067 IPackageManager pm = AppGlobals.getPackageManager();
Jack Palevich91a27ae2009-06-15 21:03:24 -070068 try {
69 ApplicationInfo applicationInfo = pm.getApplicationInfo(appName, 0);
70 if (applicationInfo != null) {
71 version = applicationInfo.targetSdkVersion;
72 }
73 } catch (android.os.RemoteException e) {
74 // ignore
75 }
76 Log.e("OpenGLES", String.format(
77 "Application %s (SDK target %d) called a GL11 Pointer method with an indirect Buffer.",
78 appName, version));
79 if (version <= Build.VERSION_CODES.CUPCAKE) {
80 result = true;
81 }
82 return result;
83 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080084