diff options
author | Sven Gothel <[email protected]> | 2015-03-06 10:03:59 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-03-06 10:03:59 +0100 |
commit | 23f7addf6eefde27efe7e47c320ad31b7f81dc2c (patch) | |
tree | 354c1cb7a88f82ad36b4856b05c2eb01e9923c7a /src/jogl/classes/com/jogamp/opengl/util | |
parent | 27ebb38b9ffd3cc8f4ee3b97509b0f32ef2680aa (diff) |
Bug 1135 - Cleanup: Class ownership change of static GL enumerates
GLBufferStateTracker now also supports GL4.GL_QUERY_BUFFER
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util')
9 files changed, 28 insertions, 29 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java b/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java index 6a2a02387..3340af8ab 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java +++ b/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java @@ -717,7 +717,7 @@ public class GLBuffers extends Buffers { break; case GL.GL_RGB: case GL2ES3.GL_RGB_INTEGER: - case GL2GL3.GL_BGR: + case GL.GL_BGR: case GL2GL3.GL_BGR_INTEGER: compCount = 3; break; diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java b/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java index 4575de959..c82f63898 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java +++ b/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java @@ -270,7 +270,7 @@ public class GLPixelBuffer { break; } break; - case GL2GL3.GL_BGR: + case GL.GL_BGR: if( GL.GL_UNSIGNED_BYTE == glDataType ) { pixFmt = PixelFormat.BGR888; } @@ -392,7 +392,7 @@ public class GLPixelBuffer { break; case BGR888: if( glp.isGL2GL3() ) { - df = GL2GL3.GL_BGR; + df = GL.GL_BGR; } break; case RGBx8888: diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java index bb1c5e9b1..f8a66fe45 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java @@ -136,8 +136,8 @@ public class ShaderCode { case GL2ES2.GL_VERTEX_SHADER: case GL2ES2.GL_FRAGMENT_SHADER: case GL3.GL_GEOMETRY_SHADER: - case GL4.GL_TESS_CONTROL_SHADER: - case GL4.GL_TESS_EVALUATION_SHADER: + case GL3.GL_TESS_CONTROL_SHADER: + case GL3.GL_TESS_EVALUATION_SHADER: break; default: throw new GLException("Unknown shader type: "+type); @@ -166,8 +166,8 @@ public class ShaderCode { case GL2ES2.GL_VERTEX_SHADER: case GL2ES2.GL_FRAGMENT_SHADER: case GL3.GL_GEOMETRY_SHADER: - case GL4.GL_TESS_CONTROL_SHADER: - case GL4.GL_TESS_EVALUATION_SHADER: + case GL3.GL_TESS_CONTROL_SHADER: + case GL3.GL_TESS_EVALUATION_SHADER: break; default: throw new GLException("Unknown shader type: "+type); @@ -292,9 +292,9 @@ public class ShaderCode { return binary?SUFFIX_FRAGMENT_BINARY:SUFFIX_FRAGMENT_SOURCE; case GL3.GL_GEOMETRY_SHADER: return binary?SUFFIX_GEOMETRY_BINARY:SUFFIX_GEOMETRY_SOURCE; - case GL4.GL_TESS_CONTROL_SHADER: + case GL3.GL_TESS_CONTROL_SHADER: return binary?SUFFIX_TESS_CONTROL_BINARY:SUFFIX_TESS_CONTROL_SOURCE; - case GL4.GL_TESS_EVALUATION_SHADER: + case GL3.GL_TESS_EVALUATION_SHADER: return binary?SUFFIX_TESS_EVALUATION_BINARY:SUFFIX_TESS_EVALUATION_SOURCE; default: throw new GLException("illegal shader type: "+type); @@ -520,9 +520,9 @@ public class ShaderCode { return "FRAGMENT_SHADER"; case GL3.GL_GEOMETRY_SHADER: return "GEOMETRY_SHADER"; - case GL4.GL_TESS_CONTROL_SHADER: + case GL3.GL_TESS_CONTROL_SHADER: return "TESS_CONTROL_SHADER"; - case GL4.GL_TESS_EVALUATION_SHADER: + case GL3.GL_TESS_EVALUATION_SHADER: return "TESS_EVALUATION_SHADER"; } return "UNKNOWN_SHADER"; @@ -1019,8 +1019,8 @@ public class ShaderCode { switch ( shaderType ) { case GL2ES2.GL_VERTEX_SHADER: case GL3.GL_GEOMETRY_SHADER: - case GL4.GL_TESS_CONTROL_SHADER: - case GL4.GL_TESS_EVALUATION_SHADER: + case GL3.GL_TESS_CONTROL_SHADER: + case GL3.GL_TESS_EVALUATION_SHADER: defaultPrecision = gl3_default_precision_vp_gp; break; case GL2ES2.GL_FRAGMENT_SHADER: defaultPrecision = gl3_default_precision_fp; break; diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java index ce1acc6d7..615d8c24f 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java @@ -42,7 +42,6 @@ import java.nio.Buffer; import com.jogamp.opengl.GLProfile; import com.jogamp.common.nio.Buffers; -import com.jogamp.opengl.util.GLBuffers; import com.jogamp.opengl.util.GLPixelBuffer.GLPixelAttributes; /** diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java index 27571ae0d..54a552f33 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java @@ -60,6 +60,7 @@ import com.jogamp.nativewindow.util.DimensionImmutable; import com.jogamp.nativewindow.util.PixelFormat; import com.jogamp.opengl.GL; import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GL2ES3; import com.jogamp.opengl.GL2GL3; import com.jogamp.opengl.GLContext; import com.jogamp.opengl.GLException; @@ -597,9 +598,9 @@ public class TextureIO { final GL2GL3 gl = _gl.getGL2GL3(); texture.bind(gl); - final int internalFormat = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2GL3.GL_TEXTURE_INTERNAL_FORMAT); - final int width = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2GL3.GL_TEXTURE_WIDTH); - final int height = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2GL3.GL_TEXTURE_HEIGHT); + final int internalFormat = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2ES3.GL_TEXTURE_INTERNAL_FORMAT); + final int width = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2ES3.GL_TEXTURE_WIDTH); + final int height = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2ES3.GL_TEXTURE_HEIGHT); final int border = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_BORDER); TextureData data = null; if (internalFormat == GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT || @@ -617,7 +618,7 @@ public class TextureIO { int fetchedFormat = 0; switch (internalFormat) { case GL.GL_RGB: - case GL2GL3.GL_BGR: + case GL.GL_BGR: case GL.GL_RGB8: bytesPerPixel = 3; fetchedFormat = GL.GL_RGB; @@ -1303,7 +1304,7 @@ public class TextureIO { final int pixelType = pixelAttribs.type; if ((pixelFormat == GL.GL_RGB || pixelFormat == GL.GL_RGBA || - pixelFormat == GL2GL3.GL_BGR || + pixelFormat == GL.GL_BGR || pixelFormat == GL.GL_BGRA ) && (pixelType == GL.GL_BYTE || pixelType == GL.GL_UNSIGNED_BYTE)) { diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java index 1866c5921..12332dbe7 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java @@ -29,8 +29,8 @@ package com.jogamp.opengl.util.texture; import com.jogamp.opengl.GL; import com.jogamp.opengl.GL2ES2; +import com.jogamp.opengl.GL2ES3; import com.jogamp.opengl.GL2GL3; -import com.jogamp.opengl.GL3; import com.jogamp.opengl.GLException; /** @@ -61,11 +61,11 @@ public class TextureState { case GL2ES2.GL_TEXTURE_3D: texBindQName = GL2ES2.GL_TEXTURE_BINDING_3D; break; case GL2GL3.GL_TEXTURE_1D: texBindQName = GL2GL3.GL_TEXTURE_BINDING_1D; break; case GL2GL3.GL_TEXTURE_1D_ARRAY: texBindQName = GL2GL3.GL_TEXTURE_BINDING_1D_ARRAY; break; - case GL.GL_TEXTURE_2D_ARRAY: texBindQName = GL.GL_TEXTURE_BINDING_2D_ARRAY; break; + case GL2ES3.GL_TEXTURE_2D_ARRAY: texBindQName = GL2ES3.GL_TEXTURE_BINDING_2D_ARRAY; break; case GL2GL3.GL_TEXTURE_RECTANGLE: texBindQName = GL2GL3.GL_TEXTURE_BINDING_RECTANGLE; break; case GL2GL3.GL_TEXTURE_BUFFER: texBindQName = GL2GL3.GL_TEXTURE_BINDING_BUFFER; break; - case GL3.GL_TEXTURE_2D_MULTISAMPLE: texBindQName = GL3.GL_TEXTURE_BINDING_2D_MULTISAMPLE; break; - case GL3.GL_TEXTURE_2D_MULTISAMPLE_ARRAY: texBindQName = GL3.GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY; break; + case GL2ES2.GL_TEXTURE_2D_MULTISAMPLE: texBindQName = GL2ES2.GL_TEXTURE_BINDING_2D_MULTISAMPLE; break; + case GL2ES2.GL_TEXTURE_2D_MULTISAMPLE_ARRAY: texBindQName = GL2ES2.GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY; break; default: texBindQName = 0; } return texBindQName; diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java index aa0be8e9b..692061cec 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java @@ -232,7 +232,7 @@ public class AWTTextureData extends TextureData { // we can pass the image data directly to OpenGL only if // we have an integral number of pixels in each scanline if ((scanlineStride % 3) == 0) { - pixelAttributes = new GLPixelAttributes(GL2GL3.GL_BGR, GL.GL_UNSIGNED_BYTE); + pixelAttributes = new GLPixelAttributes(GL.GL_BGR, GL.GL_UNSIGNED_BYTE); rowLength = scanlineStride / 3; alignment = 1; } else { diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java index 700de593f..99954ae86 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java @@ -44,7 +44,6 @@ import java.nio.*; import java.nio.channels.FileChannel; import com.jogamp.opengl.*; - import com.jogamp.common.util.IOUtil; import com.jogamp.opengl.util.texture.*; @@ -112,7 +111,7 @@ public class NetPbmTextureWriter implements TextureWriter { final int pixelType = data.getPixelType(); if ((pixelFormat == GL.GL_RGB || pixelFormat == GL.GL_RGBA || - pixelFormat == GL2GL3.GL_BGR || + pixelFormat == GL.GL_BGR || pixelFormat == GL.GL_BGRA ) && (pixelType == GL.GL_BYTE || pixelType == GL.GL_UNSIGNED_BYTE)) { @@ -125,7 +124,7 @@ public class NetPbmTextureWriter implements TextureWriter { final int comps = ( pixelFormat == GL.GL_RGBA || pixelFormat == GL.GL_BGRA ) ? 4 : 3 ; - if( pixelFormat == GL2GL3.GL_BGR || pixelFormat == GL.GL_BGRA ) { + if( pixelFormat == GL.GL_BGR || pixelFormat == GL.GL_BGRA ) { // Must reverse order of red and blue channels to get correct results for (int i = 0; i < buf.remaining(); i += comps) { final byte red = buf.get(i + 0); diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java index bb872714c..831927a90 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java @@ -42,8 +42,8 @@ package com.jogamp.opengl.util.texture.spi; import java.io.*; import java.nio.*; import java.nio.channels.*; -import com.jogamp.opengl.*; +import com.jogamp.opengl.*; import com.jogamp.common.util.IOUtil; /** @@ -352,7 +352,7 @@ public class TGAImage { bpp = header.pixelDepth / 8; switch (header.pixelDepth) { case 24: - format = glp.isGL2GL3() ? GL2GL3.GL_BGR : GL.GL_RGB; + format = glp.isGL2GL3() ? GL.GL_BGR : GL.GL_RGB; break; case 32: boolean useBGRA = glp.isGL2GL3(); |