GLWrapperBase.java revision 9066cfe9886ac131c34d59ed0e2d287b0e3c0087
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 17package android.opengl; 18 19import java.nio.Buffer; 20import java.nio.FloatBuffer; 21import java.nio.IntBuffer; 22import javax.microedition.khronos.opengles.GL; 23import javax.microedition.khronos.opengles.GL10; 24import javax.microedition.khronos.opengles.GL10Ext; 25import javax.microedition.khronos.opengles.GL11; 26import javax.microedition.khronos.opengles.GL11Ext; 27import javax.microedition.khronos.opengles.GL11ExtensionPack; 28 29/** 30 * The abstract base class for a GL wrapper. Provides 31 * some convenient instance variables and default implementations. 32 */ 33abstract class GLWrapperBase 34 implements GL, GL10, GL10Ext, GL11, GL11Ext { 35 public GLWrapperBase(GL gl) { 36 mgl = (GL10) gl; 37 if (gl instanceof GL10Ext) { 38 mgl10Ext = (GL10Ext) gl; 39 } 40 if (gl instanceof GL11) { 41 mgl11 = (GL11) gl; 42 } 43 if (gl instanceof GL11Ext) { 44 mgl11Ext = (GL11Ext) gl; 45 } 46 if (gl instanceof GL11ExtensionPack) { 47 mgl11ExtensionPack = (GL11ExtensionPack) gl; 48 } 49 } 50 51 protected GL10 mgl; 52 protected GL10Ext mgl10Ext; 53 protected GL11 mgl11; 54 protected GL11Ext mgl11Ext; 55 protected GL11ExtensionPack mgl11ExtensionPack; 56 57 // Unsupported GL11 methods 58 59 public void glGetPointerv(int pname, java.nio.Buffer[] params) { 60 throw new UnsupportedOperationException(); 61 } 62 63 // VBO versions of *Pointer and *Elements methods 64 public void glColorPointer(int size, int type, int stride, int offset) { 65 throw new UnsupportedOperationException(); 66 } 67 68 public void glNormalPointer(int type, int stride, int offset) { 69 throw new UnsupportedOperationException(); 70 } 71 72 public void glTexCoordPointer(int size, int type, int stride, int offset) { 73 throw new UnsupportedOperationException(); 74 } 75 76 public void glVertexPointer(int size, int type, int stride, int offset) { 77 throw new UnsupportedOperationException(); 78 } 79 80 public void glDrawElements(int mode, int count, int type, int offset) { 81 throw new UnsupportedOperationException(); 82 } 83 84 public void glBindBuffer(int target, int buffer) { 85 throw new UnsupportedOperationException(); 86 } 87 88 public void glBufferData(int target, int size, Buffer data, int usage) { 89 throw new UnsupportedOperationException(); 90 } 91 92 public void glBufferSubData(int target, int offset, int size, Buffer data) { 93 throw new UnsupportedOperationException(); 94 } 95 96 public void glColor4ub(byte red, byte green, byte blue, byte alpha) { 97 throw new UnsupportedOperationException(); 98 } 99 100 public void glDeleteBuffers(int n, int[] buffers, int offset) { 101 throw new UnsupportedOperationException(); 102 } 103 104 public void glDeleteBuffers(int n, IntBuffer buffers) { 105 throw new UnsupportedOperationException(); 106 } 107 108 public void glGenBuffers(int n, int[] buffers, int offset) { 109 throw new UnsupportedOperationException(); 110 } 111 112 public void glGenBuffers(int n, IntBuffer buffers) { 113 throw new UnsupportedOperationException(); 114 } 115 116 public void glGetBooleanv(int pname, boolean[] params, int offset) { 117 throw new UnsupportedOperationException(); 118 } 119 120 public void glGetBooleanv(int pname, IntBuffer params) { 121 throw new UnsupportedOperationException(); 122 } 123 124 public void glGetBufferParameteriv(int target, int pname, int[] params, int offset) { 125 throw new UnsupportedOperationException(); 126 } 127 128 public void glGetBufferParameteriv(int target, int pname, IntBuffer params) { 129 throw new UnsupportedOperationException(); 130 } 131 132 public void glGetClipPlanef(int pname, float[] eqn, int offset) { 133 throw new UnsupportedOperationException(); 134 } 135 136 public void glGetClipPlanef(int pname, FloatBuffer eqn) { 137 throw new UnsupportedOperationException(); 138 } 139 140 public void glGetClipPlanex(int pname, int[] eqn, int offset) { 141 throw new UnsupportedOperationException(); 142 } 143 144 public void glGetClipPlanex(int pname, IntBuffer eqn) { 145 throw new UnsupportedOperationException(); 146 } 147 148 public void glGetFixedv(int pname, int[] params, int offset) { 149 throw new UnsupportedOperationException(); 150 } 151 152 public void glGetFixedv(int pname, IntBuffer params) { 153 throw new UnsupportedOperationException(); 154 } 155 156 public void glGetFloatv(int pname, float[] params, int offset) { 157 throw new UnsupportedOperationException(); 158 } 159 160 public void glGetFloatv(int pname, FloatBuffer params) { 161 throw new UnsupportedOperationException(); 162 } 163 164 public void glGetLightfv(int light, int pname, float[] params, int offset) { 165 throw new UnsupportedOperationException(); 166 } 167 168 public void glGetLightfv(int light, int pname, FloatBuffer params) { 169 throw new UnsupportedOperationException(); 170 } 171 172 public void glGetLightxv(int light, int pname, int[] params, int offset) { 173 throw new UnsupportedOperationException(); 174 } 175 176 public void glGetLightxv(int light, int pname, IntBuffer params) { 177 throw new UnsupportedOperationException(); 178 } 179 180 public void glGetMaterialfv(int face, int pname, float[] params, int offset) { 181 throw new UnsupportedOperationException(); 182 } 183 184 public void glGetMaterialfv(int face, int pname, FloatBuffer params) { 185 throw new UnsupportedOperationException(); 186 } 187 188 public void glGetMaterialxv(int face, int pname, int[] params, int offset) { 189 throw new UnsupportedOperationException(); 190 } 191 192 public void glGetMaterialxv(int face, int pname, IntBuffer params) { 193 throw new UnsupportedOperationException(); 194 } 195 196 public void glGetTexEnviv(int env, int pname, int[] params, int offset) { 197 throw new UnsupportedOperationException(); 198 } 199 200 public void glGetTexEnviv(int env, int pname, IntBuffer params) { 201 throw new UnsupportedOperationException(); 202 } 203 204 public void glGetTexEnvxv(int env, int pname, int[] params, int offset) { 205 throw new UnsupportedOperationException(); 206 } 207 208 public void glGetTexEnvxv(int env, int pname, IntBuffer params) { 209 throw new UnsupportedOperationException(); 210 } 211 212 public void glGetTexParameterfv(int target, int pname, float[] params, int offset) { 213 throw new UnsupportedOperationException(); 214 } 215 216 public void glGetTexParameterfv(int target, int pname, FloatBuffer params) { 217 throw new UnsupportedOperationException(); 218 } 219 220 public void glGetTexParameteriv(int target, int pname, int[] params, int offset) { 221 throw new UnsupportedOperationException(); 222 } 223 224 public void glGetTexParameteriv(int target, int pname, IntBuffer params) { 225 throw new UnsupportedOperationException(); 226 } 227 228 public void glGetTexParameterxv(int target, int pname, int[] params, int offset) { 229 throw new UnsupportedOperationException(); 230 } 231 232 public void glGetTexParameterxv(int target, int pname, IntBuffer params) { 233 throw new UnsupportedOperationException(); 234 } 235 236 public boolean glIsBuffer(int buffer) { 237 throw new UnsupportedOperationException(); 238 } 239 240 public boolean glIsEnabled(int cap) { 241 throw new UnsupportedOperationException(); 242 } 243 244 public boolean glIsTexture(int texture) { 245 throw new UnsupportedOperationException(); 246 } 247 248 public void glPointParameterf(int pname, float param) { 249 throw new UnsupportedOperationException(); 250 } 251 252 public void glPointParameterfv(int pname, float[] params, int offset) { 253 throw new UnsupportedOperationException(); 254 } 255 256 public void glPointParameterfv(int pname, FloatBuffer params) { 257 throw new UnsupportedOperationException(); 258 } 259 260 public void glPointParameterx(int pname, int param) { 261 throw new UnsupportedOperationException(); 262 } 263 264 public void glPointParameterxv(int pname, int[] params, int offset) { 265 throw new UnsupportedOperationException(); 266 } 267 268 public void glPointParameterxv(int pname, IntBuffer params) { 269 throw new UnsupportedOperationException(); 270 } 271 272 public void glPointSizePointerOES(int type, int stride, Buffer pointer) { 273 throw new UnsupportedOperationException(); 274 } 275 276 public void glTexEnvi(int target, int pname, int param) { 277 throw new UnsupportedOperationException(); 278 } 279 280 public void glTexEnviv(int target, int pname, int[] params, int offset) { 281 throw new UnsupportedOperationException(); 282 } 283 284 public void glTexEnviv(int target, int pname, IntBuffer params) { 285 throw new UnsupportedOperationException(); 286 } 287 288 public void glTexParameterfv(int target, int pname, float[] params, int offset) { 289 throw new UnsupportedOperationException(); 290 } 291 292 public void glTexParameterfv(int target, int pname, FloatBuffer params) { 293 throw new UnsupportedOperationException(); 294 } 295 296 public void glTexParameteri(int target, int pname, int param) { 297 throw new UnsupportedOperationException(); 298 } 299 300 public void glTexParameterxv(int target, int pname, int[] params, int offset) { 301 throw new UnsupportedOperationException(); 302 } 303 304 public void glTexParameterxv(int target, int pname, IntBuffer params) { 305 throw new UnsupportedOperationException(); 306 } 307 308 // Unsupported GL11Ext methods 309 310 public void glCurrentPaletteMatrixOES(int matrixpaletteindex) { 311 throw new UnsupportedOperationException(); 312 } 313 314 public void glLoadPaletteFromModelViewMatrixOES() { 315 throw new UnsupportedOperationException(); 316 } 317 318 public void glMatrixIndexPointerOES(int size, int type, int stride, Buffer pointer) { 319 throw new UnsupportedOperationException(); 320 } 321 322 public void glMatrixIndexPointerOES(int size, int type, int stride, int offset) { 323 throw new UnsupportedOperationException(); 324 } 325 326 public void glWeightPointerOES(int size, int type, int stride, Buffer pointer) { 327 throw new UnsupportedOperationException(); 328 } 329 330 public void glWeightPointerOES(int size, int type, int stride, int offset) { 331 throw new UnsupportedOperationException(); 332 } 333 334 // Unsupported GL11ExtensionPack methods 335 336 public void glBindFramebufferOES(int target, int framebuffer) { 337 throw new UnsupportedOperationException(); 338 } 339 340 public void glBindRenderbufferOES(int target, int renderbuffer) { 341 throw new UnsupportedOperationException(); 342 } 343 344 public void glBlendEquation(int mode) { 345 throw new UnsupportedOperationException(); 346 } 347 348 public void glBlendEquationSeparate(int modeRGB, int modeAlpha) { 349 throw new UnsupportedOperationException(); 350 } 351 352 public void glBlendFuncSeparate(int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) { 353 throw new UnsupportedOperationException(); 354 } 355 356 int glCheckFramebufferStatusOES(int target) { 357 throw new UnsupportedOperationException(); 358 } 359 360 public void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize) { 361 throw new UnsupportedOperationException(); 362 } 363 364 public void glDeleteFramebuffersOES(int n, int[] framebuffers, int offset) { 365 throw new UnsupportedOperationException(); 366 } 367 368 public void glDeleteFramebuffersOES(int n, java.nio.IntBuffer framebuffers) { 369 throw new UnsupportedOperationException(); 370 } 371 372 public void glDeleteRenderbuffersOES(int n, int[] renderbuffers, int offset) { 373 throw new UnsupportedOperationException(); 374 } 375 376 public void glDeleteRenderbuffersOES(int n, java.nio.IntBuffer renderbuffers) { 377 throw new UnsupportedOperationException(); 378 } 379 380 public void glFramebufferRenderbufferOES(int target, int attachment, int renderbuffertarget, int renderbuffer) { 381 throw new UnsupportedOperationException(); 382 } 383 384 public void glFramebufferTexture2DOES(int target, int attachment, int textarget, int texture, int level) { 385 throw new UnsupportedOperationException(); 386 } 387 388 public void glGenerateMipmapOES(int target) { 389 throw new UnsupportedOperationException(); 390 } 391 392 public void glGenFramebuffersOES(int n, int[] framebuffers, int offset) { 393 throw new UnsupportedOperationException(); 394 } 395 396 public void glGenFramebuffersOES(int n, java.nio.IntBuffer framebuffers) { 397 throw new UnsupportedOperationException(); 398 } 399 400 public void glGenRenderbuffersOES(int n, int[] renderbuffers, int offset) { 401 throw new UnsupportedOperationException(); 402 } 403 404 public void glGenRenderbuffersOES(int n, java.nio.IntBuffer renderbuffers) { 405 throw new UnsupportedOperationException(); 406 } 407 408 public void glGetFramebufferAttachmentParameterivOES(int target, int attachment, int pname, int[] params, int offset) { 409 throw new UnsupportedOperationException(); 410 } 411 412 public void glGetFramebufferAttachmentParameterivOES(int target, int attachment, int pname, java.nio.IntBuffer params) { 413 throw new UnsupportedOperationException(); 414 } 415 416 public void glGetRenderbufferParameterivOES(int target, int pname, int[] params, int offset) { 417 throw new UnsupportedOperationException(); 418 } 419 420 public void glGetRenderbufferParameterivOES(int target, int pname, java.nio.IntBuffer params) { 421 throw new UnsupportedOperationException(); 422 } 423 424 public void glGetTexGenfv(int coord, int pname, float[] params, int offset) { 425 throw new UnsupportedOperationException(); 426 } 427 428 public void glGetTexGenfv(int coord, int pname, java.nio.FloatBuffer params) { 429 throw new UnsupportedOperationException(); 430 } 431 432 public void glGetTexGeniv(int coord, int pname, int[] params, int offset) { 433 throw new UnsupportedOperationException(); 434 } 435 436 public void glGetTexGeniv(int coord, int pname, java.nio.IntBuffer params) { 437 throw new UnsupportedOperationException(); 438 } 439 440 public void glGetTexGenxv(int coord, int pname, int[] params, int offset) { 441 throw new UnsupportedOperationException(); 442 } 443 444 public void glGetTexGenxv(int coord, int pname, java.nio.IntBuffer params) { 445 throw new UnsupportedOperationException(); 446 } 447 448 public boolean glIsFramebufferOES(int framebuffer) { 449 throw new UnsupportedOperationException(); 450 } 451 452 public boolean glIsRenderbufferOES(int renderbuffer) { 453 throw new UnsupportedOperationException(); 454 } 455 456 public void glRenderbufferStorageOES(int target, int internalformat, int width, int height) { 457 throw new UnsupportedOperationException(); 458 } 459 460 public void glTexGenf(int coord, int pname, float param) { 461 throw new UnsupportedOperationException(); 462 } 463 464 public void glTexGenfv(int coord, int pname, float[] params, int offset) { 465 throw new UnsupportedOperationException(); 466 } 467 468 public void glTexGenfv(int coord, int pname, java.nio.FloatBuffer params) { 469 throw new UnsupportedOperationException(); 470 } 471 472 public void glTexGeni(int coord, int pname, int param) { 473 throw new UnsupportedOperationException(); 474 } 475 476 public void glTexGeniv(int coord, int pname, int[] params, int offset) { 477 throw new UnsupportedOperationException(); 478 } 479 480 public void glTexGeniv(int coord, int pname, java.nio.IntBuffer params) { 481 throw new UnsupportedOperationException(); 482 } 483 484 public void glTexGenx(int coord, int pname, int param) { 485 throw new UnsupportedOperationException(); 486 } 487 488 public void glTexGenxv(int coord, int pname, int[] params, int offset) { 489 throw new UnsupportedOperationException(); 490 } 491 492 public void glTexGenxv(int coord, int pname, java.nio.IntBuffer params) { 493 throw new UnsupportedOperationException(); 494 } 495} 496