blob: 32c9d7d09fb2500cde2bebea18ccb1006246760a [file] [log] [blame]
The Android Open Source Projectedbf3b62009-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 Hughes98757502011-04-08 20:01:01 -070021import android.app.AppGlobals;
Orion Hodson62d2c9c2020-03-27 15:09:33 +000022import android.compat.annotation.UnsupportedAppUsage;
Jack Palevichc96812c2009-06-15 21:03:24 -070023import android.content.pm.ApplicationInfo;
24import android.content.pm.IPackageManager;
25import android.os.Build;
Mathias Agopian54c28182013-02-22 20:04:22 -080026import android.os.UserHandle;
Jack Palevichc96812c2009-06-15 21:03:24 -070027import android.util.Log;
28
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080029import java.nio.Buffer;
Orion Hodson62d2c9c2020-03-27 15:09:33 +000030
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080031import javax.microedition.khronos.opengles.GL10;
32import javax.microedition.khronos.opengles.GL10Ext;
33import javax.microedition.khronos.opengles.GL11;
34import javax.microedition.khronos.opengles.GL11Ext;
35import javax.microedition.khronos.opengles.GL11ExtensionPack;
36
37public class GLImpl implements GL10, GL10Ext, GL11, GL11Ext, GL11ExtensionPack {
38
39 // Private accessors for native code
40
41 native private static void _nativeClassInit();
42 static {
Jesse Hall2fc72d12014-05-18 15:31:54 -070043 _nativeClassInit();
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080044 }
45
46 Buffer _colorPointer = null;
47 Buffer _normalPointer = null;
48 Buffer _texCoordPointer = null;
49 Buffer _vertexPointer = null;
Jack Palevich66089a32009-12-08 15:43:51 +080050 Buffer _pointSizePointerOES = null;
51 Buffer _matrixIndexPointerOES = null;
52 Buffer _weightPointerOES = null;
Jack Paleviche44e45c2010-01-28 20:28:32 +080053
54 private boolean haveCheckedExtensions;
55 private boolean have_OES_blend_equation_separate;
56 private boolean have_OES_blend_subtract;
57 private boolean have_OES_framebuffer_object;
58 private boolean have_OES_texture_cube_map;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080059
Orion Hodson62d2c9c2020-03-27 15:09:33 +000060 @UnsupportedAppUsage
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080061 public GLImpl() {
62 }
63
Jack Palevichc96812c2009-06-15 21:03:24 -070064 public void glGetPointerv(int pname, java.nio.Buffer[] params) {
65 throw new UnsupportedOperationException("glGetPointerv");
66 }
67
68 private static boolean allowIndirectBuffers(String appName) {
69 boolean result = false;
70 int version = 0;
Elliott Hughes98757502011-04-08 20:01:01 -070071 IPackageManager pm = AppGlobals.getPackageManager();
Jack Palevichc96812c2009-06-15 21:03:24 -070072 try {
Mathias Agopian54c28182013-02-22 20:04:22 -080073 ApplicationInfo applicationInfo = pm.getApplicationInfo(appName, 0, UserHandle.myUserId());
Jack Palevichc96812c2009-06-15 21:03:24 -070074 if (applicationInfo != null) {
75 version = applicationInfo.targetSdkVersion;
76 }
77 } catch (android.os.RemoteException e) {
78 // ignore
79 }
80 Log.e("OpenGLES", String.format(
81 "Application %s (SDK target %d) called a GL11 Pointer method with an indirect Buffer.",
82 appName, version));
83 if (version <= Build.VERSION_CODES.CUPCAKE) {
84 result = true;
85 }
86 return result;
87 }
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080088