blob: cf252f9cc5d6b1411e93b355601d161c1f51fcc0 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2007 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
17package android.opengl;
18
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080019import javax.microedition.khronos.opengles.GL;
20import javax.microedition.khronos.opengles.GL10;
21import javax.microedition.khronos.opengles.GL10Ext;
22import javax.microedition.khronos.opengles.GL11;
23import javax.microedition.khronos.opengles.GL11Ext;
24import javax.microedition.khronos.opengles.GL11ExtensionPack;
25
26/**
27 * The abstract base class for a GL wrapper. Provides
28 * some convenient instance variables and default implementations.
29 */
30abstract class GLWrapperBase
Jack Palevich29406da2011-01-27 14:46:52 -080031 implements GL, GL10, GL10Ext, GL11, GL11Ext, GL11ExtensionPack {
Jack Palevichd70213e2009-10-12 19:20:49 -070032 public GLWrapperBase(GL gl) {
33 mgl = (GL10) gl;
34 if (gl instanceof GL10Ext) {
35 mgl10Ext = (GL10Ext) gl;
36 }
37 if (gl instanceof GL11) {
38 mgl11 = (GL11) gl;
39 }
40 if (gl instanceof GL11Ext) {
41 mgl11Ext = (GL11Ext) gl;
42 }
43 if (gl instanceof GL11ExtensionPack) {
44 mgl11ExtensionPack = (GL11ExtensionPack) gl;
45 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080046 }
47
Jack Palevichd70213e2009-10-12 19:20:49 -070048 protected GL10 mgl;
49 protected GL10Ext mgl10Ext;
50 protected GL11 mgl11;
51 protected GL11Ext mgl11Ext;
52 protected GL11ExtensionPack mgl11ExtensionPack;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080053}