| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.opengl; |
| 18 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 19 | import javax.microedition.khronos.opengles.GL; |
| 20 | import javax.microedition.khronos.opengles.GL10; |
| 21 | import javax.microedition.khronos.opengles.GL10Ext; |
| 22 | import javax.microedition.khronos.opengles.GL11; |
| 23 | import javax.microedition.khronos.opengles.GL11Ext; |
| 24 | import 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 | */ |
| 30 | abstract class GLWrapperBase |
| Jack Palevich | 29406da | 2011-01-27 14:46:52 -0800 | [diff] [blame] | 31 | implements GL, GL10, GL10Ext, GL11, GL11Ext, GL11ExtensionPack { |
| Jack Palevich | d70213e | 2009-10-12 19:20:49 -0700 | [diff] [blame] | 32 | 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 Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 46 | } |
| 47 | |
| Jack Palevich | d70213e | 2009-10-12 19:20:49 -0700 | [diff] [blame] | 48 | protected GL10 mgl; |
| 49 | protected GL10Ext mgl10Ext; |
| 50 | protected GL11 mgl11; |
| 51 | protected GL11Ext mgl11Ext; |
| 52 | protected GL11ExtensionPack mgl11ExtensionPack; |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 53 | } |