protected static void checkLimit(final Buffer buffer) { if (buffer == null) { return; } if (buffer.limit() == 0) { throw new RendererException("Attempting to upload empty buffer (limit = 0), that's an error"); } if (buffer.remaining() == 0) { throw new RendererException("Attempting to upload empty buffer (remaining = 0), that's an error"); } } }
private static void checkLimit(Buffer buffer) { if (buffer == null) { return; } if (buffer.limit() == 0) { throw new RendererException("Attempting to upload empty buffer (limit = 0), that's an error"); } if (buffer.remaining() == 0) { throw new RendererException("Attempting to upload empty buffer (remaining = 0), that's an error"); } }
private static void checkLimit(Buffer buffer) { if (buffer == null) { return; } if (buffer.limit() == 0) { throw new RendererException("Attempting to upload empty buffer (limit = 0), that's an error"); } if (buffer.remaining() == 0) { throw new RendererException("Attempting to upload empty buffer (remaining = 0), that's an error"); } }
private static void checkLimit(Buffer buffer) { if (buffer == null) { return; } if (buffer.limit() == 0) { throw new RendererException("Attempting to upload empty buffer (limit = 0), that's an error"); } if (buffer.remaining() == 0) { throw new RendererException("Attempting to upload empty buffer (remaining = 0), that's an error"); } }
private static void checkLimit(Buffer buffer) { if (buffer == null) { return; } if (buffer.limit() == 0) { throw new RendererException("Attempting to upload empty buffer (limit = 0), that's an error"); } if (buffer.remaining() == 0) { throw new RendererException("Attempting to upload empty buffer (remaining = 0), that's an error"); } }
private static void checkLimit(Buffer buffer) { if (buffer == null) { return; } if (buffer.limit() == 0) { throw new RendererException("Attempting to upload empty buffer (limit = 0), that's an error"); } if (buffer.remaining() == 0) { throw new RendererException("Attempting to upload empty buffer (remaining = 0), that's an error"); } }
private static void checkLimit(Buffer buffer) { if (buffer == null) { return; } if (buffer.limit() == 0) { throw new RendererException("Attempting to upload empty buffer (limit = 0), that's an error"); } if (buffer.remaining() == 0) { throw new RendererException("Attempting to upload empty buffer (remaining = 0), that's an error"); } }
private static void checkLimit(Buffer buffer) { if (buffer == null) { return; } if (buffer.limit() == 0) { throw new RendererException("Attempting to upload empty buffer (limit = 0), that's an error"); } if (buffer.remaining() == 0) { throw new RendererException("Attempting to upload empty buffer (remaining = 0), that's an error"); } }
private static void checkLimit(Buffer buffer) { if (buffer == null) { return; } if (buffer.limit() == 0) { throw new RendererException("Attempting to upload empty buffer (limit = 0), that's an error"); } if (buffer.remaining() == 0) { throw new RendererException("Attempting to upload empty buffer (remaining = 0), that's an error"); } }
private static void checkLimit(Buffer buffer) { if (buffer == null) { return; } if (buffer.limit() == 0) { throw new RendererException("Attempting to upload empty buffer (limit = 0), that's an error"); } if (buffer.remaining() == 0) { throw new RendererException("Attempting to upload empty buffer (remaining = 0), that's an error"); } }
public static void checkGLError() { if (!ENABLE_ERROR_CHECKING) { return; } int error = glGetError(); if (error != 0) { String message = null;//GLU.gluErrorString(error); if (message == null) { throw new RendererException("An unknown [" + error + "] OpenGL error has occurred."); } else { throw new RendererException("An OpenGL error has occurred: " + message); } } }
public static GLImageFormat getImageFormatWithError(Format fmt, boolean isSrgb) { GLImageFormat glFmt = getImageFormat(fmt, isSrgb); if (glFmt == null) { throw new RendererException("Image format '" + fmt + "' is unsupported by the video hardware."); } return glFmt; }
/** * Checks for an OpenGL error and throws a {@link RendererException} if * there is one. Ignores the value of * {@link RendererUtil#ENABLE_ERROR_CHECKING}. */ public static void checkGLErrorForced() { int error = GLES20.glGetError(); if (error != 0) { String message = GLU.gluErrorString(error); if (message == null) { throw new RendererException("An unknown OpenGL error has occurred."); } else { throw new RendererException("An OpenGL error has occurred: " + message); } } }
throw new RendererException("Multisample textures are not supported" + " by the video hardware."); throw new RendererException("Array textures are not supported" + " by the video hardware."); throw new RendererException("3D textures are not supported" + " by the video hardware.");
/** * Checks for an OpenGL error and throws a {@link RendererException} if * there is one. Does nothing if {@link RendererUtil#ENABLE_ERROR_CHECKING} * is set to * <code>false</code>. */ public static void checkGLError() { if (!ENABLE_ERROR_CHECKING) { return; } int error = GLES20.glGetError(); if (error != 0) { String message = GLU.gluErrorString(error); if (message == null) { throw new RendererException("An unknown OpenGL error has occurred."); } else { throw new RendererException("An OpenGL error has occurred: " + message); } } } }
protected void checkError() { int err = gl.glGetError(); if (err != 0) { throw new RendererException("An OpenGL error occurred - " + decodeError(err)); } } }
public GLImageFormat getImageFormatWithError(Format fmt, boolean isSrgb) { //if the passed format is one kind of depth there isno point in getting the srgb format; isSrgb = isSrgb && !fmt.isDepthFormat(); GLImageFormat glFmt = getImageFormat(fmt, isSrgb); if (glFmt == null && isSrgb) { glFmt = getImageFormat(fmt, false); logger.log(Level.WARNING, "No sRGB format available for ''{0}''. Failling back to linear.", fmt); } if (glFmt == null) { throw new RendererException("Image format '" + fmt + "' is unsupported by the video hardware."); } return glFmt; }
public Vector2f[] getFrameBufferSamplePositions(FrameBuffer fb) { if (fb.getSamples() <= 1) { throw new IllegalArgumentException("Framebuffer must be multisampled"); } if (!caps.contains(Caps.TextureMultisample)) { throw new RendererException("Multisampled textures are not supported"); } setFrameBuffer(fb); Vector2f[] samplePositions = new Vector2f[fb.getSamples()]; FloatBuffer samplePos = BufferUtils.createFloatBuffer(2); for (int i = 0; i < samplePositions.length; i++) { glext.glGetMultisample(GLExt.GL_SAMPLE_POSITION, i, samplePos); samplePos.clear(); samplePositions[i] = new Vector2f(samplePos.get(0) - 0.5f, samplePos.get(1) - 0.5f); } return samplePositions; }
throw new RendererException("Resolution " + fb.getWidth() + ":" + fb.getHeight() + " is not supported.");
public void renderMesh(Mesh mesh, int lod, int count, VertexBuffer[] instanceData) { if (mesh.getVertexCount() == 0 || mesh.getTriangleCount() == 0 || count == 0) { return; } if (count > 1 && !caps.contains(Caps.MeshInstancing)) { throw new RendererException("Mesh instancing is not supported by the video hardware"); } if (mesh.getLineWidth() != 1f && context.lineWidth != mesh.getLineWidth()) { gl.glLineWidth(mesh.getLineWidth()); context.lineWidth = mesh.getLineWidth(); } if (gl4 != null && mesh.getMode().equals(Mode.Patch)) { gl4.glPatchParameter(mesh.getPatchVertexCount()); } statistics.onMeshDrawn(mesh, lod, count); // if (ctxCaps.GL_ARB_vertex_array_object){ // renderMeshVertexArray(mesh, lod, count); // }else{ renderMeshDefault(mesh, lod, count, instanceData); // } }