diff options
author | Julien Gouesse <[email protected]> | 2019-06-01 23:19:22 +0200 |
---|---|---|
committer | Julien Gouesse <[email protected]> | 2019-06-01 23:19:22 +0200 |
commit | d4d68cdd232edd700ef7c874f563fb9472bae3f9 (patch) | |
tree | a3bf5451057f51a9794fcf9b75d594b146298864 | |
parent | 88c55a6d3cadaabe60e9e859030d4a216fafad55 (diff) |
Fixes some errors in the Java documentation of ardor3d-jogl
7 files changed, 206 insertions, 93 deletions
diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/CapsUtil.java b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/CapsUtil.java index 93bd55c..b9103f3 100644 --- a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/CapsUtil.java +++ b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/CapsUtil.java @@ -54,11 +54,16 @@ public class CapsUtil { * for internal use only, tolerates artificial display settings containing hints * * @param settings + * the settings * @param onscreen + * <code>true</code> if it's on screen * @param bitmapRequested + * <code>true</code> if the bitmap support is requested * @param pbufferRequested + * <code>true</code> if the pbuffer support is requested * @param fboRequested - * @return + * <code>true</code> if the FBO support is requested + * @return the capabilities object */ GLCapabilities getCapsForSettingsWithHints(final DisplaySettings settings, final boolean onscreen, final boolean bitmapRequested, final boolean pbufferRequested, final boolean fboRequested) { @@ -78,7 +83,8 @@ public class CapsUtil { // Validate window dimensions. if (settings.getWidth() <= 0 || settings.getHeight() <= 0) { - throw new Ardor3dException("Invalid resolution values: " + settings.getWidth() + " " + settings.getHeight()); + throw new Ardor3dException( + "Invalid resolution values: " + settings.getWidth() + " " + settings.getHeight()); } // Validate bit depth. @@ -89,7 +95,8 @@ public class CapsUtil { // Validate rotation if (settings.getRotation() != MonitorMode.ROTATE_0 && settings.getRotation() != MonitorMode.ROTATE_90 - && settings.getRotation() != MonitorMode.ROTATE_180 && settings.getRotation() != MonitorMode.ROTATE_270) { + && settings.getRotation() != MonitorMode.ROTATE_180 + && settings.getRotation() != MonitorMode.ROTATE_270) { throw new Ardor3dException("Invalid rotation: " + settings.getRotation()); } diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglNewtWindow.java b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglNewtWindow.java index 148db60..0b2d33a 100644 --- a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglNewtWindow.java +++ b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglNewtWindow.java @@ -82,8 +82,8 @@ public class JoglNewtWindow implements NativeCanvas, NewtWindowContainer { final MonitorDevice primaryMonitor = _newtWindow.getScreen().getPrimaryMonitor(); _monitorDevices.add(primaryMonitor); // disables HiDPI, see https://github.com/gouessej/Ardor3D/issues/14 - _newtWindow.setSurfaceScale(new float[] { ScalableSurface.IDENTITY_PIXELSCALE, - ScalableSurface.IDENTITY_PIXELSCALE }); + _newtWindow.setSurfaceScale( + new float[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE }); _drawerGLRunnable = new JoglDrawerRunnable(canvasRenderer); final int width, height; if (settings.isFullScreen() && settings.getWidth() == 0 || settings.getHeight() == 0) { @@ -152,8 +152,8 @@ public class JoglNewtWindow implements NativeCanvas, NewtWindowContainer { break; } case 0: { - byBppMonitorModes = MonitorModeUtil.filterByBpp(monitorModes, currentMode.getSurfaceSize() - .getBitsPerPixel()); + byBppMonitorModes = MonitorModeUtil.filterByBpp(monitorModes, + currentMode.getSurfaceSize().getBitsPerPixel()); break; } case -1: { @@ -296,6 +296,7 @@ public class JoglNewtWindow implements NativeCanvas, NewtWindowContainer { * Enables or disables automatic buffer swapping for this JoglNewtWindow. By default this property is set to false * * @param autoSwapBufferModeEnabled + * <code>true</code> if the automatic buffer swapping is enabled */ public void setAutoSwapBufferMode(final boolean autoSwapBufferModeEnabled) { _newtWindow.setAutoSwapBufferMode(autoSwapBufferModeEnabled); diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/image/util/jogl/JoglImageUtil.java b/ardor3d-jogl/src/main/java/com/ardor3d/image/util/jogl/JoglImageUtil.java index f964d59..2ea547a 100644 --- a/ardor3d-jogl/src/main/java/com/ardor3d/image/util/jogl/JoglImageUtil.java +++ b/ardor3d-jogl/src/main/java/com/ardor3d/image/util/jogl/JoglImageUtil.java @@ -44,6 +44,7 @@ public class JoglImageUtil { * contain multiple layers (for example, in the case of cube maps or 3D textures). * * @param capsUtil + * capabilities utility * @param input * the Ardor3D Image to convert * @return the TextureData instance(s) created in the conversion diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglRenderer.java b/ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglRenderer.java index fa6c954..7465c7a 100644 --- a/ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglRenderer.java +++ b/ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglRenderer.java @@ -329,6 +329,9 @@ public class JoglRenderer extends AbstractRenderer { /** * re-initializes the GL context for rendering of another piece of geometry. + * + * @param g + * the mesh */ protected void postdrawGeometry(final Mesh g) { // Nothing to do here yet @@ -830,8 +833,9 @@ public class JoglRenderer extends AbstractRenderer { final boolean valid = rendRecord.isTexturesValid(); boolean wasOn; if (ts != null) { - final int max = caps.isMultitextureSupported() ? Math.min(caps.getNumberOfFragmentTexCoordUnits(), - TextureState.MAX_TEXTURES) : 1; + final int max = caps.isMultitextureSupported() + ? Math.min(caps.getNumberOfFragmentTexCoordUnits(), TextureState.MAX_TEXTURES) + : 1; for (int i = 0; i < max; i++) { wasOn = (enabledTextures & (2 << i)) != 0; @@ -1146,8 +1150,9 @@ public class JoglRenderer extends AbstractRenderer { final boolean valid = rendRecord.isTexturesValid(); boolean wasOn; if (ts != null) { - final int max = caps.isMultitextureSupported() ? Math.min(caps.getNumberOfFragmentTexCoordUnits(), - TextureState.MAX_TEXTURES) : 1; + final int max = caps.isMultitextureSupported() + ? Math.min(caps.getNumberOfFragmentTexCoordUnits(), TextureState.MAX_TEXTURES) + : 1; for (int i = 0; i < max; i++) { wasOn = (enabledTextures & (2 << i)) != 0; @@ -1224,7 +1229,8 @@ public class JoglRenderer extends AbstractRenderer { final RendererRecord rendRecord = context.getRendererRecord(); final ContextCapabilities caps = context.getCapabilities(); - final int lengthBytes = getTotalInterleavedSize(context, vertexCoords, normalCoords, colorCoords, textureCoords); + final int lengthBytes = getTotalInterleavedSize(context, vertexCoords, normalCoords, colorCoords, + textureCoords); int currLengthBytes = 0; if (interleaved.getBufferLimit() > 0) { interleaved.getBuffer().rewind(); @@ -1278,8 +1284,9 @@ public class JoglRenderer extends AbstractRenderer { final boolean valid = rendRecord.isTexturesValid(); boolean exists, wasOn; if (ts != null) { - final int max = caps.isMultitextureSupported() ? Math.min(caps.getNumberOfFragmentTexCoordUnits(), - TextureState.MAX_TEXTURES) : 1; + final int max = caps.isMultitextureSupported() + ? Math.min(caps.getNumberOfFragmentTexCoordUnits(), TextureState.MAX_TEXTURES) + : 1; for (int i = 0; i < max; i++) { wasOn = (enabledTextures & (2 << i)) != 0; exists = i < textureCoords.size() && textureCoords.get(i) != null @@ -1592,7 +1599,7 @@ public class JoglRenderer extends AbstractRenderer { glMode = GL.GL_TRIANGLE_FAN; break; case Quads: - glMode = GL2GL3.GL_QUADS; + glMode = GL2ES3.GL_QUADS; break; case QuadStrip: glMode = GL2.GL_QUAD_STRIP; diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglMaterialStateUtil.java b/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglMaterialStateUtil.java index 58e659f..35815b7 100644 --- a/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglMaterialStateUtil.java +++ b/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglMaterialStateUtil.java @@ -3,17 +3,13 @@ * * This file is part of Ardor3D. * - * Ardor3D is free software: you can redistribute it and/or modify it + * Ardor3D is free software: you can redistribute it and/or modify it * under the terms of its license which may be found in the accompanying * LICENSE file or at <http://www.ardor3d.com/LICENSE>. */ package com.ardor3d.scene.state.jogl; -import com.jogamp.opengl.GL; -import com.jogamp.opengl.GLContext; -import com.jogamp.opengl.fixedfunc.GLLightingFunc; - import com.ardor3d.math.type.ReadOnlyColorRGBA; import com.ardor3d.renderer.ContextManager; import com.ardor3d.renderer.RenderContext; @@ -23,6 +19,9 @@ import com.ardor3d.renderer.state.MaterialState.ColorMaterial; import com.ardor3d.renderer.state.MaterialState.MaterialFace; import com.ardor3d.renderer.state.RenderState.StateType; import com.ardor3d.renderer.state.record.MaterialStateRecord; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GLContext; +import com.jogamp.opengl.fixedfunc.GLLightingFunc; public abstract class JoglMaterialStateUtil { @@ -69,7 +68,8 @@ public abstract class JoglMaterialStateUtil { if (frontColor.equals(backColor)) { // consolidate to one call if (!isVertexProvidedColor(MaterialFace.FrontAndBack, glMatColor, record)) { - if (!record.isValid() || !record.isSetColor(MaterialFace.FrontAndBack, glMatColor, frontColor, record)) { + if (!record.isValid() + || !record.isSetColor(MaterialFace.FrontAndBack, glMatColor, frontColor, record)) { record.tempColorBuff.clear(); record.tempColorBuff.put(frontColor.getRed()).put(frontColor.getGreen()).put(frontColor.getBlue()) .put(frontColor.getAlpha()); @@ -195,7 +195,10 @@ public abstract class JoglMaterialStateUtil { /** * Converts the color material setting of this state to a GL constant. - * + * + * @param material + * the color material + * * @return the GL constant */ private static int getGLColorMaterial(final ColorMaterial material) { @@ -218,7 +221,10 @@ public abstract class JoglMaterialStateUtil { /** * Converts the material face setting of this state to a GL constant. - * + * + * @param face + * the material face + * * @return the GL constant */ private static int getGLMaterialFace(final MaterialFace face) { diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglShaderObjectsStateUtil.java b/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglShaderObjectsStateUtil.java index 3788548..3932716 100644 --- a/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglShaderObjectsStateUtil.java +++ b/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglShaderObjectsStateUtil.java @@ -30,7 +30,6 @@ import com.ardor3d.util.shader.ShaderVariable; import com.jogamp.opengl.GL; import com.jogamp.opengl.GL2; import com.jogamp.opengl.GL2ES2; -import com.jogamp.opengl.GL3; import com.jogamp.opengl.GL3ES3; import com.jogamp.opengl.GLContext; @@ -88,8 +87,8 @@ public abstract class JoglShaderObjectsStateUtil { compiled.clear(); if (gl.isGL2()) { gl.getGL2().glCompileShaderARB(state._vertexShaderID); - gl.getGL2() - .glGetObjectParameterivARB(state._vertexShaderID, GL2.GL_OBJECT_COMPILE_STATUS_ARB, compiled); + gl.getGL2().glGetObjectParameterivARB(state._vertexShaderID, GL2.GL_OBJECT_COMPILE_STATUS_ARB, + compiled); } else { if (gl.isGL2ES2()) { gl.getGL2ES2().glCompileShader(state._vertexShaderID); @@ -174,10 +173,10 @@ public abstract class JoglShaderObjectsStateUtil { } if (gl.isGL2()) { - state._geometryShaderID = (int) gl.getGL2().glCreateShaderObjectARB(GL3.GL_GEOMETRY_SHADER); + state._geometryShaderID = (int) gl.getGL2().glCreateShaderObjectARB(GL3ES3.GL_GEOMETRY_SHADER); } else { if (gl.isGL2ES2()) { - state._geometryShaderID = gl.getGL2ES2().glCreateShader(GL3.GL_GEOMETRY_SHADER); + state._geometryShaderID = gl.getGL2ES2().glCreateShader(GL3ES3.GL_GEOMETRY_SHADER); } } @@ -232,11 +231,12 @@ public abstract class JoglShaderObjectsStateUtil { } if (gl.isGL2()) { - state._tessellationControlShaderID = (int) gl.getGL2().glCreateShaderObjectARB( - GL3.GL_TESS_CONTROL_SHADER); + state._tessellationControlShaderID = (int) gl.getGL2() + .glCreateShaderObjectARB(GL3ES3.GL_TESS_CONTROL_SHADER); } else { if (gl.isGL2ES2()) { - state._tessellationControlShaderID = gl.getGL2ES2().glCreateShader(GL3.GL_TESS_CONTROL_SHADER); + state._tessellationControlShaderID = gl.getGL2ES2() + .glCreateShader(GL3ES3.GL_TESS_CONTROL_SHADER); } } @@ -290,12 +290,12 @@ public abstract class JoglShaderObjectsStateUtil { } if (gl.isGL2()) { - state._tessellationEvaluationShaderID = (int) gl.getGL2().glCreateShaderObjectARB( - GL3.GL_TESS_CONTROL_SHADER); + state._tessellationEvaluationShaderID = (int) gl.getGL2() + .glCreateShaderObjectARB(GL3ES3.GL_TESS_CONTROL_SHADER); } else { if (gl.isGL2ES2()) { - state._tessellationEvaluationShaderID = gl.getGL2ES2().glCreateShader( - GL3.GL_TESS_CONTROL_SHADER); + state._tessellationEvaluationShaderID = gl.getGL2ES2() + .glCreateShader(GL3ES3.GL_TESS_CONTROL_SHADER); } } @@ -466,7 +466,13 @@ public abstract class JoglShaderObjectsStateUtil { } } - /** Removes the fragment shader */ + /** + * Removes the fragment shader + * + * @param state + * the GLSL shader objects state + * + */ private static void removeFragShader(final GLSLShaderObjectsState state) { final GL gl = GLContext.getCurrentGL(); @@ -483,7 +489,13 @@ public abstract class JoglShaderObjectsStateUtil { } } - /** Removes the vertex shader */ + /** + * Removes the vertex shader + * + * @param state + * the GLSL shader objects state + * + */ private static void removeVertShader(final GLSLShaderObjectsState state) { final GL gl = GLContext.getCurrentGL(); @@ -500,7 +512,13 @@ public abstract class JoglShaderObjectsStateUtil { } } - /** Removes the geometry shader */ + /** + * Removes the geometry shader + * + * @param state + * the GLSL shader objects state + * + */ private static void removeGeomShader(final GLSLShaderObjectsState state) { final GL gl = GLContext.getCurrentGL(); @@ -517,7 +535,13 @@ public abstract class JoglShaderObjectsStateUtil { } } - /** Removes the tessellation control shader */ + /** + * Removes the tessellation control shader + * + * @param state + * the GLSL shader objects state + * + */ private static void removeTessControlShader(final GLSLShaderObjectsState state) { final GL gl = GLContext.getCurrentGL(); @@ -534,7 +558,13 @@ public abstract class JoglShaderObjectsStateUtil { } } - /** Removes the tessellation evaluation shader */ + /** + * Removes the tessellation evaluation shader + * + * @param state + * the GLSL shader objects state + * + */ private static void removeTessEvalShader(final GLSLShaderObjectsState state) { final GL gl = GLContext.getCurrentGL(); @@ -551,7 +581,13 @@ public abstract class JoglShaderObjectsStateUtil { } } - /** Removes the compute shader */ + /** + * Removes the compute shader + * + * @param state + * the GLSL shader objects state + * + */ private static void removeCompShader(final GLSLShaderObjectsState state) { final GL gl = GLContext.getCurrentGL(); @@ -575,6 +611,9 @@ public abstract class JoglShaderObjectsStateUtil { * the compiler state for a given shader * @param shaderId * shader's id + * + * @param shaderName + * the shader's name */ private static void checkShaderError(final int compilerState, final int shaderId, final String shaderName) { final GL gl = GLContext.getCurrentGL(); diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglTextureStateUtil.java b/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglTextureStateUtil.java index 4aa1ad6..1a91e4e 100644 --- a/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglTextureStateUtil.java +++ b/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglTextureStateUtil.java @@ -120,6 +120,11 @@ public class JoglTextureStateUtil { /** * bind texture and upload image data to card + * + * @param texture + * the texture + * @param unit + * the texture unit */ public static void update(final Texture texture, final int unit) { final RenderContext context = ContextManager.getCurrentContext(); @@ -166,8 +171,9 @@ public class JoglTextureStateUtil { + image.getWidth() + " x " + image.getHeight()); } if (actualWidth > maxSize || actualHeight > maxSize) { - logger.warning("(card unsupported) Attempted to apply texture with size bigger than max texture size [" - + maxSize + "]: " + image.getWidth() + " x " + image.getHeight()); + logger.warning( + "(card unsupported) Attempted to apply texture with size bigger than max texture size [" + + maxSize + "]: " + image.getWidth() + " x " + image.getHeight()); } int w = actualWidth; @@ -213,7 +219,8 @@ public class JoglTextureStateUtil { } } - if (!texture.getMinificationFilter().usesMipMapLevels() && !texture.getTextureStoreFormat().isCompressed()) { + if (!texture.getMinificationFilter().usesMipMapLevels() + && !texture.getTextureStoreFormat().isCompressed()) { // Load textures which do not need mipmap auto-generating and // which aren't using compressed images. @@ -226,8 +233,8 @@ public class JoglTextureStateUtil { gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, JoglTextureUtil.getGLInternalFormat(texture.getTextureStoreFormat()), image.getWidth(), image.getHeight(), hasBorder ? 1 : 0, - JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), - JoglTextureUtil.getGLPixelDataType(image.getDataType()), image.getData(0)); + JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), + JoglTextureUtil.getGLPixelDataType(image.getDataType()), image.getData(0)); break; case OneDimensional: // ensure the buffer is ready for reading @@ -237,8 +244,8 @@ public class JoglTextureStateUtil { gl.getGL2GL3().glTexImage1D(GL2GL3.GL_TEXTURE_1D, 0, JoglTextureUtil.getGLInternalFormat(texture.getTextureStoreFormat()), image.getWidth(), hasBorder ? 1 : 0, - JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), - JoglTextureUtil.getGLPixelDataType(image.getDataType()), image.getData(0)); + JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), + JoglTextureUtil.getGLPixelDataType(image.getDataType()), image.getData(0)); } break; case ThreeDimensional: @@ -269,8 +276,8 @@ public class JoglTextureStateUtil { gl.getGL2GL3().glTexImage3D(GL2ES2.GL_TEXTURE_3D, 0, JoglTextureUtil.getGLInternalFormat(texture.getTextureStoreFormat()), image.getWidth(), image.getHeight(), image.getDepth(), hasBorder ? 1 : 0, - JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), - JoglTextureUtil.getGLPixelDataType(image.getDataType()), data); + JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), + JoglTextureUtil.getGLPixelDataType(image.getDataType()), data); } else { logger.warning("This card does not support Texture3D."); } @@ -286,9 +293,9 @@ public class JoglTextureStateUtil { gl.glTexImage2D(getGLCubeMapFace(face), 0, JoglTextureUtil.getGLInternalFormat(texture.getTextureStoreFormat()), image.getWidth(), image.getWidth(), hasBorder ? 1 : 0, - JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), - JoglTextureUtil.getGLPixelDataType(image.getDataType()), - image.getData(face.ordinal())); + JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), + JoglTextureUtil.getGLPixelDataType(image.getDataType()), + image.getData(face.ordinal())); } } else { logger.warning("This card does not support Cubemaps."); @@ -326,8 +333,8 @@ public class JoglTextureStateUtil { gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, JoglTextureUtil.getGLInternalFormat(texture.getTextureStoreFormat()), image.getWidth(), image.getHeight(), hasBorder ? 1 : 0, - JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), - JoglTextureUtil.getGLPixelDataType(image.getDataType()), image.getData(0)); + JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), + JoglTextureUtil.getGLPixelDataType(image.getDataType()), image.getData(0)); } else { // FIXME workaround for the bug 1045: https://jogamp.org/bugzilla/show_bug.cgi?id=1045 if (gl.isGL2() /* || gl.isGL2ES1() */) { @@ -349,13 +356,14 @@ public class JoglTextureStateUtil { gl.getGL2GL3().glTexImage1D(GL2GL3.GL_TEXTURE_1D, 0, JoglTextureUtil.getGLInternalFormat(texture.getTextureStoreFormat()), image.getWidth(), hasBorder ? 1 : 0, - JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), - JoglTextureUtil.getGLPixelDataType(image.getDataType()), image.getData(0)); + JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), + JoglTextureUtil.getGLPixelDataType(image.getDataType()), image.getData(0)); } } else { // Note: JOGL's GLU class does not support // gluBuild1DMipmaps. - logger.warning("non-fbo 1d mipmap generation is not currently supported. Use DDS or a non-mipmap minification filter."); + logger.warning( + "non-fbo 1d mipmap generation is not currently supported. Use DDS or a non-mipmap minification filter."); return; } break; @@ -389,12 +397,13 @@ public class JoglTextureStateUtil { gl.getGL2GL3().glTexImage3D(GL2ES2.GL_TEXTURE_3D, 0, JoglTextureUtil.getGLInternalFormat(texture.getTextureStoreFormat()), image.getWidth(), image.getHeight(), image.getDepth(), hasBorder ? 1 : 0, - JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), - JoglTextureUtil.getGLPixelDataType(image.getDataType()), data); + JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), + JoglTextureUtil.getGLPixelDataType(image.getDataType()), data); } else { // Note: JOGL's GLU class does not support // gluBuild3DMipmaps. - logger.warning("non-fbo 3d mipmap generation is not currently supported. Use DDS or a non-mipmap minification filter."); + logger.warning( + "non-fbo 3d mipmap generation is not currently supported. Use DDS or a non-mipmap minification filter."); return; } } else { @@ -414,9 +423,9 @@ public class JoglTextureStateUtil { gl.glTexImage2D(getGLCubeMapFace(face), 0, JoglTextureUtil.getGLInternalFormat(texture.getTextureStoreFormat()), image.getWidth(), image.getWidth(), hasBorder ? 1 : 0, - JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), - JoglTextureUtil.getGLPixelDataType(image.getDataType()), - image.getData(face.ordinal())); + JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), + JoglTextureUtil.getGLPixelDataType(image.getDataType()), + image.getData(face.ordinal())); } } else { // FIXME workaround for the bug 1045: https://jogamp.org/bugzilla/show_bug.cgi?id=1045 @@ -481,14 +490,14 @@ public class JoglTextureStateUtil { if (texture.getTextureStoreFormat().isCompressed()) { gl.glCompressedTexImage2D(getGLCubeMapFace(face), m, - JoglTextureUtil.getGLInternalFormat(texture.getTextureStoreFormat()), - width, height, hasBorder ? 1 : 0, mipSizes[m], data); + JoglTextureUtil.getGLInternalFormat(texture.getTextureStoreFormat()), width, + height, hasBorder ? 1 : 0, mipSizes[m], data); } else { gl.glTexImage2D(getGLCubeMapFace(face), m, - JoglTextureUtil.getGLInternalFormat(texture.getTextureStoreFormat()), - width, height, hasBorder ? 1 : 0, - JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), - JoglTextureUtil.getGLPixelDataType(image.getDataType()), data); + JoglTextureUtil.getGLInternalFormat(texture.getTextureStoreFormat()), width, + height, hasBorder ? 1 : 0, + JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), + JoglTextureUtil.getGLPixelDataType(image.getDataType()), data); } pos += mipSizes[m]; } @@ -571,14 +580,14 @@ public class JoglTextureStateUtil { case TwoDimensional: if (texture.getTextureStoreFormat().isCompressed()) { gl.glCompressedTexImage2D(GL.GL_TEXTURE_2D, m, - JoglTextureUtil.getGLInternalFormat(texture.getTextureStoreFormat()), - width, height, hasBorder ? 1 : 0, mipSizes[m], data); + JoglTextureUtil.getGLInternalFormat(texture.getTextureStoreFormat()), width, + height, hasBorder ? 1 : 0, mipSizes[m], data); } else { gl.glTexImage2D(GL.GL_TEXTURE_2D, m, - JoglTextureUtil.getGLInternalFormat(texture.getTextureStoreFormat()), - width, height, hasBorder ? 1 : 0, - JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), - JoglTextureUtil.getGLPixelDataType(image.getDataType()), data); + JoglTextureUtil.getGLInternalFormat(texture.getTextureStoreFormat()), width, + height, hasBorder ? 1 : 0, + JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), + JoglTextureUtil.getGLPixelDataType(image.getDataType()), data); } break; case OneDimensional: @@ -593,8 +602,8 @@ public class JoglTextureStateUtil { gl.getGL2GL3().glTexImage1D(GL2GL3.GL_TEXTURE_1D, m, JoglTextureUtil.getGLInternalFormat(texture.getTextureStoreFormat()), width, hasBorder ? 1 : 0, - JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), - JoglTextureUtil.getGLPixelDataType(image.getDataType()), data); + JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), + JoglTextureUtil.getGLPixelDataType(image.getDataType()), data); } } break; @@ -612,8 +621,8 @@ public class JoglTextureStateUtil { gl.getGL2ES2().glTexImage3D(GL2ES2.GL_TEXTURE_3D, m, JoglTextureUtil.getGLInternalFormat(texture.getTextureStoreFormat()), width, height, depth, hasBorder ? 1 : 0, - JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), - JoglTextureUtil.getGLPixelDataType(image.getDataType()), data); + JoglTextureUtil.getGLPixelFormat(image.getDataFormat()), + JoglTextureUtil.getGLPixelDataType(image.getDataType()), data); } } break; @@ -931,8 +940,8 @@ public class JoglTextureStateUtil { // first thing's first... if we are doing dot3 and don't // support it, disable this texture. boolean checked = false; - if (!caps.isEnvDot3TextureCombineSupported() - && (texture.getCombineFuncRGB() == CombinerFunctionRGB.Dot3RGB || texture.getCombineFuncRGB() == CombinerFunctionRGB.Dot3RGBA)) { + if (!caps.isEnvDot3TextureCombineSupported() && (texture.getCombineFuncRGB() == CombinerFunctionRGB.Dot3RGB + || texture.getCombineFuncRGB() == CombinerFunctionRGB.Dot3RGBA)) { // disable disableTexturing(unitRecord, record, unit, caps); @@ -1191,11 +1200,11 @@ public class JoglTextureStateUtil { checkAndSetUnit(unit, record, caps); TextureRecord.colorBuffer.clear(); TextureRecord.colorBuffer.put(texBlend.getRed()).put(texBlend.getGreen()).put(texBlend.getBlue()) - .put(texBlend.getAlpha()); + .put(texBlend.getAlpha()); TextureRecord.colorBuffer.rewind(); if (gl.isGL2ES1()) { - gl.getGL2ES1() - .glTexEnvfv(GL2ES1.GL_TEXTURE_ENV, GL2ES1.GL_TEXTURE_ENV_COLOR, TextureRecord.colorBuffer); + gl.getGL2ES1().glTexEnvfv(GL2ES1.GL_TEXTURE_ENV, GL2ES1.GL_TEXTURE_ENV_COLOR, + TextureRecord.colorBuffer); } unitRecord.blendColor.set(texBlend); } @@ -1206,8 +1215,8 @@ public class JoglTextureStateUtil { final GL gl = GLContext.getCurrentGL(); if (caps.isTextureLodBiasSupported()) { - final float bias = texture.getLodBias() < caps.getMaxLodBias() ? texture.getLodBias() : caps - .getMaxLodBias(); + final float bias = texture.getLodBias() < caps.getMaxLodBias() ? texture.getLodBias() + : caps.getMaxLodBias(); if (!unitRecord.isValid() || unitRecord.lodBias != bias) { checkAndSetUnit(unit, record, caps); if (gl.isGL2ES1()) { @@ -1226,7 +1235,7 @@ public class JoglTextureStateUtil { if (!texRecord.isValid() || !texRecord.borderColor.equals(texBorder)) { TextureRecord.colorBuffer.clear(); TextureRecord.colorBuffer.put(texBorder.getRed()).put(texBorder.getGreen()).put(texBorder.getBlue()) - .put(texBorder.getAlpha()); + .put(texBorder.getAlpha()); TextureRecord.colorBuffer.rewind(); if (gl.isGL2GL3()) { final int glType = getGLType(texture.getType()); @@ -1542,7 +1551,8 @@ public class JoglTextureStateUtil { } // If we support multitexturing, specify the unit we are affecting. - public static void checkAndSetUnit(final int unit, final TextureStateRecord record, final ContextCapabilities caps) { + public static void checkAndSetUnit(final int unit, final TextureStateRecord record, + final ContextCapabilities caps) { final GL gl = GLContext.getCurrentGL(); // No need to worry about valid record, since invalidate sets record's @@ -1564,7 +1574,12 @@ public class JoglTextureStateUtil { * our texture object * @param texRecord * our record of the last state of the texture in gl + * @param unit + * the texture unit * @param record + * the texture state record + * @param caps + * the capabilities */ public static void applyShadow(final Texture texture, final TextureRecord texRecord, final int unit, final TextureStateRecord record, final ContextCapabilities caps) { @@ -1613,7 +1628,12 @@ public class JoglTextureStateUtil { * our texture object * @param texRecord * our record of the last state of the texture in gl + * @param unit + * the texture unit * @param record + * the texture state record + * @param caps + * the capabilities */ public static void applyFilter(final Texture texture, final TextureRecord texRecord, final int unit, final TextureStateRecord record, final ContextCapabilities caps) { @@ -1658,8 +1678,13 @@ public class JoglTextureStateUtil { * @param texture * our texture object * @param texRecord - * our record of the last state of the unit in gl + * our record of the last state of the texture in gl + * @param unit + * the texture unit * @param record + * the texture state record + * @param caps + * the capabilities */ public static void applyWrap(final Texture3D texture, final TextureRecord texRecord, final int unit, final TextureStateRecord record, final ContextCapabilities caps) { @@ -1703,8 +1728,13 @@ public class JoglTextureStateUtil { * @param texture * our texture object * @param texRecord - * our record of the last state of the unit in gl + * our record of the last state of the texture in gl + * @param unit + * the texture unit * @param record + * the texture state record + * @param caps + * the capabilities */ public static void applyWrap(final Texture1D texture, final TextureRecord texRecord, final int unit, final TextureStateRecord record, final ContextCapabilities caps) { @@ -1727,8 +1757,13 @@ public class JoglTextureStateUtil { * @param texture * our texture object * @param texRecord - * our record of the last state of the unit in gl + * our record of the last state of the texture in gl + * @param unit + * the texture unit * @param record + * the texture state record + * @param caps + * the capabilities */ public static void applyWrap(final Texture texture, final TextureRecord texRecord, final int unit, final TextureStateRecord record, final ContextCapabilities caps) { @@ -1749,8 +1784,13 @@ public class JoglTextureStateUtil { * @param texture * our texture object * @param texRecord - * our record of the last state of the unit in gl + * our record of the last state of the texture in gl + * @param unit + * the texture unit * @param record + * the texture state record + * @param caps + * the capabilities */ public static void applyWrap(final Texture2D texture, final TextureRecord texRecord, final int unit, final TextureStateRecord record, final ContextCapabilities caps) { @@ -1779,7 +1819,12 @@ public class JoglTextureStateUtil { * our texture object * @param texRecord * our record of the last state of the unit in gl + * @param unit + * the texture unit * @param record + * the texture state record + * @param caps + * the capabilities */ public static void applyWrap(final TextureCubeMap cubeMap, final TextureRecord texRecord, final int unit, final TextureStateRecord record, final ContextCapabilities caps) { @@ -1863,6 +1908,13 @@ public class JoglTextureStateUtil { /** * Useful for external jogl based classes that need to safely set the current texture. + * + * @param texture + * the texture + * @param unit + * the texture unit + * @param invalidateState + * <code>true</code> if the state has to be invalidated */ public static void doTextureBind(final Texture texture, final int unit, final boolean invalidateState) { final GL gl = GLContext.getCurrentGL(); |