From 73d2a436f92e360126167d9ce09b3d9637204921 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Tue, 8 Jul 2014 10:48:58 +0200
Subject: Findbugs.switch-case: GLBuffers.bytesPerPixel(..) throw GLException
 for type BITMAP && format !COLOR_INDEX || !STENCIL_INDEX

---
 src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'src/jogl/classes/com/jogamp/opengl')

diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java b/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java
index 67dc08450..44be29957 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java
@@ -588,7 +588,10 @@ public class GLBuffers extends Buffers {
             case GL2.GL_BITMAP:
               if (GL2.GL_COLOR_INDEX == format || GL2ES2.GL_STENCIL_INDEX == format) {
                   compSize = 1;
+              } else {
+                  throw new GLException("BITMAP type only supported for format COLOR_INDEX and STENCIL_INDEX, not 0x"+Integer.toHexString(format));
               }
+              break;
             case GL.GL_BYTE:
             case GL.GL_UNSIGNED_BYTE:
               compSize = 1;
-- 
cgit v1.2.3