From ec2d94ca26ddab8ec67135ebc5f2d0a43f6a4c25 Mon Sep 17 00:00:00 2001
From: Sven Gothel
- * The data must comply with the chosen {@link AudioFormat} as returned by {@link #initSink(AudioFormat)}.
- *
- * {@link #init(AudioFormat, float, int, int, int)} must be called first.
- *
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java
index 06e3ccda5..b75ad3b17 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java
@@ -50,6 +50,9 @@ public class AWTGLReadBufferUtil extends GLReadBufferUtil {
super(new AWTGLPixelBuffer.AWTGLPixelBufferProvider( glp.isGL2ES3() /* allowRowStride */ ), alpha, false);
}
+ /**
+ * Returns the {@link AWTGLPixelBuffer}, as filled by previous call to {@link #readPixels(GL, int, int, int, int, boolean)}.
+ */
public AWTGLPixelBuffer getAWTGLPixelBuffer() { return (AWTGLPixelBuffer)this.getPixelBuffer(); }
/**
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java b/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java
deleted file mode 100644
index ac208044b..000000000
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java
+++ /dev/null
@@ -1,414 +0,0 @@
-/*
- * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2013 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * - Redistribution of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistribution in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- */
-
-package com.jogamp.opengl.util.awt;
-
-import java.awt.image.BufferedImage;
-import java.awt.image.DataBufferByte;
-import java.io.File;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-import javax.imageio.ImageIO;
-import javax.media.opengl.GL;
-import javax.media.opengl.GL2;
-import javax.media.opengl.GL2GL3;
-import javax.media.opengl.GLContext;
-import javax.media.opengl.GLDrawable;
-import javax.media.opengl.GLException;
-
-import com.jogamp.common.util.IOUtil;
-import com.jogamp.opengl.GLExtensions;
-import com.jogamp.opengl.util.GLPixelStorageModes;
-import com.jogamp.opengl.util.TGAWriter;
-
-/**
- * Utilities for taking screenshots of OpenGL applications.
- * @deprecated Please consider using {@link com.jogamp.opengl.util.GLReadBufferUtil},
- * which is AWT independent and does not require a CPU based vertical image flip
- * in case drawable {@link GLDrawable#isGLOriented() is in OpenGL orientation}.
- * Further more you may use {@link AWTGLReadBufferUtil} to read out
- * the framebuffer into a BufferedImage for further AWT processing.
- */
-public class Screenshot {
- private Screenshot() {}
-
- /**
- * Takes a fast screenshot of the current OpenGL drawable to a Targa
- * file. Requires the OpenGL context for the desired drawable to be
- * current. Takes the screenshot from the last assigned read buffer,
- * or the OpenGL default read buffer if none has been specified by
- * the user (GL_FRONT for single-buffered configurations and GL_BACK
- * for double-buffered configurations). This is the fastest
- * mechanism for taking a screenshot of an application. Contributed
- * by Carsten Weisse of Bytonic Software (http://bytonic.de/).
- *
- * No alpha channel is written with this variant.
- *
- * @param file the file to write containing the screenshot
- * @param width the width of the current drawable
- * @param height the height of the current drawable
- *
- * @throws GLException if an OpenGL context was not current or
- * another OpenGL-related error occurred
- * @throws IOException if an I/O error occurred while writing the
- * file
- */
- public static void writeToTargaFile(final File file,
- final int width,
- final int height) throws GLException, IOException {
- writeToTargaFile(file, width, height, false);
- }
-
- /**
- * Takes a fast screenshot of the current OpenGL drawable to a Targa
- * file. Requires the OpenGL context for the desired drawable to be
- * current. Takes the screenshot from the last assigned read buffer,
- * or the OpenGL default read buffer if none has been specified by
- * the user (GL_FRONT for single-buffered configurations and GL_BACK
- * for double-buffered configurations). This is the fastest
- * mechanism for taking a screenshot of an application. Contributed
- * by Carsten Weisse of Bytonic Software (http://bytonic.de/).
- *
- * @param file the file to write containing the screenshot
- * @param width the width of the current drawable
- * @param height the height of the current drawable
- * @param alpha whether the alpha channel should be saved. If true,
- * requires GL_EXT_abgr extension to be present.
- *
- * @throws GLException if an OpenGL context was not current or
- * another OpenGL-related error occurred
- * @throws IOException if an I/O error occurred while writing the
- * file
- */
- public static void writeToTargaFile(final File file,
- final int width,
- final int height,
- final boolean alpha) throws GLException, IOException {
- writeToTargaFile(file, 0, 0, width, height, alpha);
- }
-
- /**
- * Takes a fast screenshot of the current OpenGL drawable to a Targa
- * file. Requires the OpenGL context for the desired drawable to be
- * current. Takes the screenshot from the last assigned read buffer,
- * or the OpenGL default read buffer if none has been specified by
- * the user (GL_FRONT for single-buffered configurations and GL_BACK
- * for double-buffered configurations). This is the fastest
- * mechanism for taking a screenshot of an application. Contributed
- * by Carsten Weisse of Bytonic Software (http://bytonic.de/).
- *
- * @param file the file to write containing the screenshot
- * @param x the starting x coordinate of the screenshot, measured from the lower-left
- * @param y the starting y coordinate of the screenshot, measured from the lower-left
- * @param width the width of the desired screenshot area
- * @param height the height of the desired screenshot area
- * @param alpha whether the alpha channel should be saved. If true,
- * requires GL_EXT_abgr extension to be present.
- *
- * @throws GLException if an OpenGL context was not current or
- * another OpenGL-related error occurred
- * @throws IOException if an I/O error occurred while writing the
- * file
- */
- public static void writeToTargaFile(final File file,
- final int x,
- final int y,
- final int width,
- final int height,
- final boolean alpha) throws GLException, IOException {
- if (alpha) {
- checkExtABGR();
- }
-
- final TGAWriter writer = new TGAWriter();
- writer.open(file, width, height, alpha);
- final ByteBuffer bgr = writer.getImageData();
-
- final GL gl = GLContext.getCurrentGL();
-
- // Set up pixel storage modes
- final GLPixelStorageModes psm = new GLPixelStorageModes();
- psm.setPackAlignment(gl, 1);
-
- final int readbackType = (alpha ? GL2.GL_ABGR_EXT : GL2GL3.GL_BGR);
-
- // read the BGR values into the image buffer
- gl.glReadPixels(x, y, width, height, readbackType,
- GL.GL_UNSIGNED_BYTE, bgr);
-
- // Restore pixel storage modes
- psm.restore(gl);
-
- // close the file
- writer.close();
- }
-
- /**
- * Takes a screenshot of the current OpenGL drawable to a
- * BufferedImage. Requires the OpenGL context for the desired
- * drawable to be current. Takes the screenshot from the last
- * assigned read buffer, or the OpenGL default read buffer if none
- * has been specified by the user (GL_FRONT for single-buffered
- * configurations and GL_BACK for double-buffered configurations).
- * Note that the scanlines of the resulting image are flipped
- * vertically in order to correctly match the OpenGL contents, which
- * takes time and is therefore not as fast as the Targa screenshot
- * function.
- *
- * No alpha channel is read back with this variant.
- *
- * @param width the width of the current drawable
- * @param height the height of the current drawable
- *
- * @throws GLException if an OpenGL context was not current or
- * another OpenGL-related error occurred
- */
- public static BufferedImage readToBufferedImage(final int width,
- final int height) throws GLException {
- return readToBufferedImage(width, height, false);
- }
-
- /**
- * Takes a screenshot of the current OpenGL drawable to a
- * BufferedImage. Requires the OpenGL context for the desired
- * drawable to be current. Takes the screenshot from the last
- * assigned read buffer, or the OpenGL default read buffer if none
- * has been specified by the user (GL_FRONT for single-buffered
- * configurations and GL_BACK for double-buffered configurations).
- * Note that the scanlines of the resulting image are flipped
- * vertically in order to correctly match the OpenGL contents, which
- * takes time and is therefore not as fast as the Targa screenshot
- * function.
- *
- * @param width the width of the current drawable
- * @param height the height of the current drawable
- * @param alpha whether the alpha channel should be read back. If
- * true, requires GL_EXT_abgr extension to be present.
- *
- * @throws GLException if an OpenGL context was not current or
- * another OpenGL-related error occurred
- */
- public static BufferedImage readToBufferedImage(final int width,
- final int height,
- final boolean alpha) throws GLException {
- return readToBufferedImage(0, 0, width, height, alpha);
- }
-
- /**
- * Takes a screenshot of the current OpenGL drawable to a
- * BufferedImage. Requires the OpenGL context for the desired
- * drawable to be current. Takes the screenshot from the last
- * assigned read buffer, or the OpenGL default read buffer if none
- * has been specified by the user (GL_FRONT for single-buffered
- * configurations and GL_BACK for double-buffered configurations).
- * Note that the scanlines of the resulting image are flipped
- * vertically in order to correctly match the OpenGL contents, which
- * takes time and is therefore not as fast as the Targa screenshot
- * function.
- *
- * @param x the starting x coordinate of the screenshot, measured from the lower-left
- * @param y the starting y coordinate of the screenshot, measured from the lower-left
- * @param width the width of the desired screenshot area
- * @param height the height of the desired screenshot area
- * @param alpha whether the alpha channel should be read back. If
- * true, requires GL_EXT_abgr extension to be present.
- *
- * @throws GLException if an OpenGL context was not current or
- * another OpenGL-related error occurred
- */
- public static BufferedImage readToBufferedImage(final int x,
- final int y,
- final int width,
- final int height,
- final boolean alpha) throws GLException {
- final int bufImgType = (alpha ? BufferedImage.TYPE_4BYTE_ABGR : BufferedImage.TYPE_3BYTE_BGR);
- final int readbackType = (alpha ? GL2.GL_ABGR_EXT : GL2GL3.GL_BGR);
-
- if (alpha) {
- checkExtABGR();
- }
-
- // Allocate necessary storage
- final BufferedImage image = new BufferedImage(width, height, bufImgType);
-
- final GLContext glc = GLContext.getCurrent();
- final GL gl = glc.getGL();
-
- // Set up pixel storage modes
- final GLPixelStorageModes psm = new GLPixelStorageModes();
- psm.setPackAlignment(gl, 1);
-
- // read the BGR values into the image
- gl.glReadPixels(x, y, width, height, readbackType,
- GL.GL_UNSIGNED_BYTE,
- ByteBuffer.wrap(((DataBufferByte) image.getRaster().getDataBuffer()).getData()));
-
- // Restore pixel storage modes
- psm.restore(gl);
-
- if( glc.getGLDrawable().isGLOriented() ) {
- // Must flip BufferedImage vertically for correct results
- ImageUtil.flipImageVertically(image);
- }
- return image;
- }
-
- /**
- * Takes a screenshot of the current OpenGL drawable to the
- * specified file on disk using the ImageIO package. Requires the
- * OpenGL context for the desired drawable to be current. Takes the
- * screenshot from the last assigned read buffer, or the OpenGL
- * default read buffer if none has been specified by the user
- * (GL_FRONT for single-buffered configurations and GL_BACK for
- * double-buffered configurations). This is not the fastest
- * mechanism for taking a screenshot but may be more convenient than
- * others for getting images for consumption by other packages. The
- * file format is inferred from the suffix of the given file.
- *
- * No alpha channel is saved with this variant.
- *
- * @param file the file to write containing the screenshot
- * @param width the width of the current drawable
- * @param height the height of the current drawable
- *
- * @throws GLException if an OpenGL context was not current or
- * another OpenGL-related error occurred
- *
- * @throws IOException if an I/O error occurred or if the file could
- * not be written to disk due to the requested file format being
- * unsupported by ImageIO
- */
- public static void writeToFile(final File file,
- final int width,
- final int height) throws IOException, GLException {
- writeToFile(file, width, height, false);
- }
-
- /**
- * Takes a screenshot of the current OpenGL drawable to the
- * specified file on disk using the ImageIO package. Requires the
- * OpenGL context for the desired drawable to be current. Takes the
- * screenshot from the last assigned read buffer, or the OpenGL
- * default read buffer if none has been specified by the user
- * (GL_FRONT for single-buffered configurations and GL_BACK for
- * double-buffered configurations). This is not the fastest
- * mechanism for taking a screenshot but may be more convenient than
- * others for getting images for consumption by other packages. The
- * file format is inferred from the suffix of the given file.
- *
- * Note that some file formats, in particular JPEG, can not handle
- * an alpha channel properly. If the "alpha" argument is specified
- * as true for such a file format it will be silently ignored.
- *
- * @param file the file to write containing the screenshot
- * @param width the width of the current drawable
- * @param height the height of the current drawable
- * @param alpha whether an alpha channel should be saved. If true,
- * requires GL_EXT_abgr extension to be present.
- *
- * @throws GLException if an OpenGL context was not current or
- * another OpenGL-related error occurred
- *
- * @throws IOException if an I/O error occurred or if the file could
- * not be written to disk due to the requested file format being
- * unsupported by ImageIO
- */
- public static void writeToFile(final File file,
- final int width,
- final int height,
- final boolean alpha) throws IOException, GLException {
- writeToFile(file, 0, 0, width, height, alpha);
- }
-
- /**
- * Takes a screenshot of the current OpenGL drawable to the
- * specified file on disk using the ImageIO package. Requires the
- * OpenGL context for the desired drawable to be current. Takes the
- * screenshot from the last assigned read buffer, or the OpenGL
- * default read buffer if none has been specified by the user
- * (GL_FRONT for single-buffered configurations and GL_BACK for
- * double-buffered configurations). This is not the fastest
- * mechanism for taking a screenshot but may be more convenient than
- * others for getting images for consumption by other packages. The
- * file format is inferred from the suffix of the given file.
- *
- * Note that some file formats, in particular JPEG, can not handle
- * an alpha channel properly. If the "alpha" argument is specified
- * as true for such a file format it will be silently ignored.
- *
- * @param file the file to write containing the screenshot
- * @param x the starting x coordinate of the screenshot, measured from the lower-left
- * @param y the starting y coordinate of the screenshot, measured from the lower-left
- * @param width the width of the current drawable
- * @param height the height of the current drawable
- * @param alpha whether an alpha channel should be saved. If true,
- * requires GL_EXT_abgr extension to be present.
- *
- * @throws GLException if an OpenGL context was not current or
- * another OpenGL-related error occurred
- *
- * @throws IOException if an I/O error occurred or if the file could
- * not be written to disk due to the requested file format being
- * unsupported by ImageIO
- */
- public static void writeToFile(final File file,
- final int x,
- final int y,
- final int width,
- final int height,
- boolean alpha) throws IOException, GLException {
- final String fileSuffix = IOUtil.getFileSuffix(file);
- if (alpha && (fileSuffix.equals("jpg") || fileSuffix.equals("jpeg"))) {
- // JPEGs can't deal properly with alpha channels
- alpha = false;
- }
-
- final BufferedImage image = readToBufferedImage(x, y, width, height, alpha);
- if (!ImageIO.write(image, fileSuffix, file)) {
- throw new IOException("Unsupported file format " + fileSuffix);
- }
- }
-
- private static void checkExtABGR() {
- final GL gl = GLContext.getCurrentGL();
-
- if (!gl.isExtensionAvailable(GLExtensions.EXT_abgr)) {
- throw new IllegalArgumentException("Saving alpha channel requires GL_EXT_abgr");
- }
- }
-}
diff --git a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
index bf8fe65ac..377dce190 100644
--- a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
+++ b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
@@ -198,6 +198,11 @@ public interface GLAutoDrawable extends GLDrawable {
*/
public int getGLEventListenerCount();
+ /**
+ * Returns true if all added {@link GLEventListener} are initialized, otherwise false.
+ */
+ boolean areAllGLEventListenerInitialized();
+
/**
* Returns the {@link GLEventListener} at the given index of this drawable queue.
* @param index Position of the listener to be returned.
diff --git a/src/jogl/classes/javax/media/opengl/GLBase.java b/src/jogl/classes/javax/media/opengl/GLBase.java
index c808399b8..48455c525 100644
--- a/src/jogl/classes/javax/media/opengl/GLBase.java
+++ b/src/jogl/classes/javax/media/opengl/GLBase.java
@@ -504,10 +504,6 @@ public interface GLBase {
/** Aliased entrypoint of Provides a virtual machine- and operating system-independent
- mechanism for creating {@link GLDrawable}s. The {@link javax.media.opengl.GLCapabilities} objects passed
+/** Provides a virtual machine- and operating system-independent
+ mechanism for creating {@link GLDrawable}s.
+ The {@link javax.media.opengl.GLCapabilities} objects passed
in to the various factory methods are used as a hint for the
properties of the returned drawable. The default capabilities
selection algorithm (equivalent to passing in a null {@link
@@ -72,9 +72,10 @@ import jogamp.opengl.Debug;
GLCapabilitiesChooser} which can select from the available pixel
formats. The GLCapabilitiesChooser mechanism may not be supported
by all implementations or on all platforms, in which case any
- passed GLCapabilitiesChooser will be ignored. audioDataFrame
.
- * @deprecated User shall use {@link #enqueueData(int, ByteBuffer, int)}, which allows implementation
- * to reuse specialized {@link AudioFrame} instances.
- */
- public AudioFrame enqueueData(AudioDataFrame audioDataFrame);
-
/**
* Enqueue byteCount
bytes of the remaining bytes of the given NIO {@link ByteBuffer} to this sink.
* void {@native glDepthRange}(GLclampd depth);
and void {@native glDepthRangef}(GLclampf depth);
. */
public void glDepthRange(double zNear, double zFar);
- /**
- * @deprecated Avoid original GL API namespace conflict. Use {@link #getBoundBuffer(int)}
- */
- public int glGetBoundBuffer(int target);
/**
* @param target a GL buffer (VBO) target as used in {@link GL#glBindBuffer(int, int)}, ie {@link GL#GL_ELEMENT_ARRAY_BUFFER}, {@link GL#GL_ARRAY_BUFFER}, ..
* @return the GL buffer name bound to a target via {@link GL#glBindBuffer(int, int)} or 0 if unbound.
@@ -515,10 +511,6 @@ public interface GLBase {
*/
public int getBoundBuffer(int target);
- /**
- * @deprecated Use {@link #getBufferStorage(int)}.
- */
- public long glGetBufferSize(int bufferName);
/**
* @param bufferName a GL buffer name, generated with e.g. {@link GL#glGenBuffers(int, int[], int)} and used in {@link GL#glBindBuffer(int, int)}, {@link GL#glBufferData(int, long, java.nio.Buffer, int)} or {@link GL2#glNamedBufferDataEXT(int, long, java.nio.Buffer, int)}.
* @return the size of the given GL buffer storage, see {@link GLBufferStorage}
@@ -579,19 +571,11 @@ public interface GLBase {
*/
public GLBufferStorage mapBufferRange(final int target, final long offset, final long length, final int access) throws GLException;
- /**
- * @deprecated Avoid original GL API namespace conflict. Use {@link #isVBOArrayBound()}
- */
- public boolean glIsVBOArrayBound();
/**
* @return true if a VBO is bound to {@link GL#GL_ARRAY_BUFFER} via {@link GL#glBindBuffer(int, int)}, otherwise false
*/
public boolean isVBOArrayBound();
- /**
- * @deprecated Avoid original GL API namespace conflict. Use {@link #isVBOElementArrayBound()}
- */
- public boolean glIsVBOElementArrayBound();
/**
* @return true if a VBO is bound to {@link GL#GL_ELEMENT_ARRAY_BUFFER} via {@link GL#glBindBuffer(int, int)}, otherwise false
*/
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
index 6e7caf8f8..82808a3cb 100644
--- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
+++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
@@ -59,10 +59,10 @@ import javax.media.nativewindow.UpstreamSurfaceHook;
import jogamp.opengl.Debug;
-/**
Because of the multithreaded nature of the Java platform's +
Because of the multithreaded nature of the Java platform's
Abstract Window Toolkit, it is typically not possible to immediately
reject a given {@link GLCapabilities} as being unsupportable by
either returning null
from the creation routines or
@@ -83,14 +84,15 @@ import jogamp.opengl.Debug;
implementation will cause a {@link GLException} to be raised
during the first repaint of the {@link javax.media.opengl.awt.GLCanvas} or {@link
javax.media.opengl.awt.GLJPanel} if the capabilities can not be met.
- {@link javax.media.opengl.GLPbuffer} are always
- created immediately and their creation will fail with a
- {@link javax.media.opengl.GLException} if errors occur.
The concrete GLDrawableFactory subclass instantiated by {@link +
The concrete GLDrawableFactory subclass instantiated by {@link
#getFactory getFactory} can be changed by setting the system
property opengl.factory.class.name
to the
- fully-qualified name of the desired class.
- * The {@link GLOffscreenAutoDrawable}'s {@link GLDrawable} is {@link GLDrawable#isRealized() realized} - * and it's {@link GLContext} assigned but not yet made current. - *
- *
- * In case the passed {@link GLCapabilitiesImmutable} contains default values, i.e.
- * {@link GLCapabilitiesImmutable#isOnscreen() caps.isOnscreen()} == true
,
- * it is auto-configured. Auto configuration will set {@link GLCapabilitiesImmutable caps} to offscreen
- * and FBO or Pbuffer, whichever is available in that order.
- *
- * A FBO based auto drawable, {@link GLOffscreenAutoDrawable.FBO}, is created if both {@link GLCapabilitiesImmutable#isFBO() caps.isFBO()} - * and {@link GLContext#isFBOAvailable(AbstractGraphicsDevice, GLProfile) canCreateFBO(device, caps.getGLProfile())} is true. - *
- *- * A Pbuffer based auto drawable is created if both {@link GLCapabilitiesImmutable#isPBuffer() caps.isPBuffer()} - * and {@link #canCreateGLPbuffer(AbstractGraphicsDevice, GLProfile) canCreateGLPbuffer(device)} is true. - *
- *- * If neither FBO nor Pbuffer is available, - * a simple pixmap/bitmap auto drawable is created, which is unlikely to be hardware accelerated. - *
- *
- * The resulting {@link GLOffscreenAutoDrawable} has it's own independent device instance using device
details.
- *
null
for the platform's default device.
- * @param caps the requested GLCapabilties
- * @param chooser the custom chooser, may be null for default
- * @param width the requested offscreen width
- * @param height the requested offscreen height
- * @return the created and initialized offscreen {@link GLOffscreenAutoDrawable} instance
- *
- * @throws GLException if any window system-specific errors caused
- * the creation of the Offscreen to fail.
- *
- * @see #createOffscreenDrawable(AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int)
- * @deprecated Use {@link #createOffscreenAutoDrawable(AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int)
- */
- public abstract GLOffscreenAutoDrawable createOffscreenAutoDrawable(AbstractGraphicsDevice device,
- GLCapabilitiesImmutable caps,
- GLCapabilitiesChooser chooser,
- int width, int height,
- GLContext shareWith) throws GLException;
-
/**
* Creates a {@link GLDrawable#isRealized() realized} {@link GLOffscreenAutoDrawable}
* incl it's offscreen {@link NativeSurface} with the given capabilites and dimensions.
*
* The {@link GLOffscreenAutoDrawable}'s {@link GLDrawable} is {@link GLDrawable#isRealized() realized}
* without an assigned {@link GLContext}, hence not initialized completely.
+ *
* The {@link GLContext} can be assigned later manually via {@link GLAutoDrawable#setContext(GLContext, boolean) setContext(ctx)}
* or it will be created lazily at the 1st {@link GLAutoDrawable#display() display()} method call.
+ *
* Lazy {@link GLContext} creation will take a shared {@link GLContext} into account
* which has been set {@link GLOffscreenAutoDrawable#setSharedContext(GLContext) directly}
* or {@link GLOffscreenAutoDrawable#setSharedAutoDrawable(GLAutoDrawable) via another GLAutoDrawable}.
@@ -716,38 +672,6 @@ public abstract class GLDrawableFactory {
*/
public abstract boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp);
- /**
- * Creates a GLPbuffer {@link GLAutoDrawable} with the given capabilites and dimensions.
- *
- * The GLPbuffer drawable is realized and initialized eagerly. - *
- * - * See the note in the overview documentation in {@link GLSharedContextSetter} and on - * context sharing. - * - * @param device which {@link AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may benull
for the platform's default device.
- * @param capabilities the requested capabilities
- * @param chooser the custom chooser, may be null for default
- * @param initialWidth initial width of pbuffer
- * @param initialHeight initial height of pbuffer
- * @param shareWith a shared GLContext this GLPbuffer shall use
- *
- * @return the created and initialized {@link GLPbuffer} instance
- *
- * @throws GLException if any window system-specific errors caused
- * the creation of the GLPbuffer to fail.
- *
- * @deprecated {@link GLPbuffer} is deprecated, use {@link #createOffscreenAutoDrawable(AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int, GLContext)}
- */
- public abstract GLPbuffer createGLPbuffer(AbstractGraphicsDevice device,
- GLCapabilitiesImmutable capabilities,
- GLCapabilitiesChooser chooser,
- int initialWidth,
- int initialHeight,
- GLContext shareWith)
- throws GLException;
-
-
//----------------------------------------------------------------------
// Methods for interacting with third-party OpenGL libraries
diff --git a/src/jogl/classes/javax/media/opengl/GLPbuffer.java b/src/jogl/classes/javax/media/opengl/GLPbuffer.java
deleted file mode 100644
index f36a4bf29..000000000
--- a/src/jogl/classes/javax/media/opengl/GLPbuffer.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * - Redistribution of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistribution in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- *
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package javax.media.opengl;
-
-/** Provides offscreen rendering support via pbuffers. The principal
- addition of this interface is a {@link #destroy} method to
- deallocate the pbuffer and its associated resources. It also
- contains experimental methods for accessing the pbuffer's contents
- as a texture map and enabling rendering to floating-point frame
- buffers. These methods are not guaranteed to be supported on all
- platforms and may be deprecated in a future release.
-
- @deprecated Use {@link GLOffscreenAutoDrawable} w/ {@link GLCapabilities#setFBO(boolean)}
- via {@link GLDrawableFactory#createOffscreenAutoDrawable(javax.media.nativewindow.AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int, GLContext) GLDrawableFactory.createOffscreenAutoDrawable(..)}.
- */
-public interface GLPbuffer extends GLAutoDrawable {
- /** Destroys the native resources associated with this pbuffer. It
- is not valid to call display() or any other routines on this
- pbuffer after it has been destroyed. Before destroying the
- pbuffer, the application must destroy any additional OpenGL
- contexts which have been created for the pbuffer via {@link
- #createContext}. */
- @Override
- public void destroy();
-}
diff --git a/src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java b/src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java
index 2ea4e4cd6..11ed648c2 100644
--- a/src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java
+++ b/src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java
@@ -98,12 +98,6 @@ package javax.media.opengl;
*
*/
public interface GLSharedContextSetter extends GLAutoDrawable {
- /**
- * Returns true if all {@link GLEventListener} are initialized, otherwise false.
- * @deprecated Promote method to {@link GLAutoDrawable}
- */
- boolean areAllGLEventListenerInitialized();
-
/**
* Specifies an {@link GLContext OpenGL context}, which shall be shared by this {@link GLAutoDrawable}'s {@link GLContext}.
* diff --git a/src/jogl/classes/javax/media/opengl/Threading.java b/src/jogl/classes/javax/media/opengl/Threading.java index 3ee233303..6c64cbe31 100644 --- a/src/jogl/classes/javax/media/opengl/Threading.java +++ b/src/jogl/classes/javax/media/opengl/Threading.java @@ -129,8 +129,8 @@ public class Threading { consequences and are prepared to enforce some amount of threading restrictions in their applications. Disabling single-threading, for example, may have unintended consequences - on GLAutoDrawable implementations such as GLCanvas, GLJPanel and - GLPbuffer. Currently there is no supported way to re-enable it + on GLAutoDrawable implementations such as GLCanvas and GLJPanel. + Currently there is no supported way to re-enable it once disabled, partly to discourage careless use of this method. This method should be called as early as possible in an application. */ diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java index ec834e02f..2d5e12429 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java @@ -155,6 +155,11 @@ import jogamp.opengl.awt.AWTTilePainter; *
sun.awt.noerasebackground=true
+ See details about OpenGL context sharing. +
* @throws GLException if no default profile is available for the default desktop device. */ public GLCanvas() throws GLException { @@ -209,27 +217,14 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing /** Creates a new GLCanvas component with the requested set of OpenGL capabilities, using the default OpenGL capabilities selection mechanism, on the default screen device. ++ See details about OpenGL context sharing. +
* @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device. * @see GLCanvas#GLCanvas(javax.media.opengl.GLCapabilitiesImmutable, javax.media.opengl.GLCapabilitiesChooser, javax.media.opengl.GLContext, java.awt.GraphicsDevice) */ public GLCanvas(final GLCapabilitiesImmutable capsReqUser) throws GLException { - this(capsReqUser, null, null, null); - } - - /** Creates a new GLCanvas component with the requested set of - OpenGL capabilities, using the default OpenGL capabilities - selection mechanism, on the default screen device. - * This constructor variant also supports using a shared GLContext. - * - * @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device. - * @see GLCanvas#GLCanvas(javax.media.opengl.GLCapabilitiesImmutable, javax.media.opengl.GLCapabilitiesChooser, javax.media.opengl.GLContext, java.awt.GraphicsDevice) - * @deprecated Use {@link #GLCanvas(GLCapabilitiesImmutable)} - * and set shared GLContext via {@link #setSharedContext(GLContext)} or {@link #setSharedAutoDrawable(GLAutoDrawable)}. - */ - public GLCanvas(final GLCapabilitiesImmutable capsReqUser, final GLContext shareWith) - throws GLException - { - this(capsReqUser, null, shareWith, null); + this(capsReqUser, null, null); } /** Creates a new GLCanvas component. The passed GLCapabilities @@ -242,40 +237,15 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing which to create the GLCanvas; the GLDrawableFactory uses the default screen device of the local GraphicsEnvironment if null is passed for this argument. ++ See details about OpenGL context sharing. +
* @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device. */ public GLCanvas(final GLCapabilitiesImmutable capsReqUser, final GLCapabilitiesChooser chooser, final GraphicsDevice device) throws GLException - { - this(capsReqUser, chooser, null, device); - } - - /** Creates a new GLCanvas component. The passed GLCapabilities - specifies the OpenGL capabilities for the component; if null, a - default set of capabilities is used. The GLCapabilitiesChooser - specifies the algorithm for selecting one of the available - GLCapabilities for the component; a DefaultGLCapabilitesChooser - is used if null is passed for this argument. The passed - GLContext specifies an OpenGL context with which to share - textures, display lists and other OpenGL state, and may be null - if sharing is not desired. See the note in the overview - documentation on context - sharing. The passed GraphicsDevice indicates the screen on - which to create the GLCanvas; the GLDrawableFactory uses the - default screen device of the local GraphicsEnvironment if null - is passed for this argument. - * @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device. - * @deprecated Use {@link #GLCanvas(GLCapabilitiesImmutable, GLCapabilitiesChooser, GraphicsDevice)} - * and set shared GLContext via {@link #setSharedContext(GLContext)} or {@link #setSharedAutoDrawable(GLAutoDrawable)}. - */ - public GLCanvas(GLCapabilitiesImmutable capsReqUser, - final GLCapabilitiesChooser chooser, - final GLContext shareWith, - GraphicsDevice device) - throws GLException { /* * Determination of the native window is made in 'super.addNotify()', @@ -287,29 +257,28 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing super(); if(null==capsReqUser) { - capsReqUser = new GLCapabilities(GLProfile.getDefault(GLProfile.getDefaultDevice())); + this.capsReqUser = new GLCapabilities(GLProfile.getDefault(GLProfile.getDefaultDevice())); } else { // don't allow the user to change data - capsReqUser = (GLCapabilitiesImmutable) capsReqUser.cloneMutable(); + this.capsReqUser = (GLCapabilitiesImmutable) capsReqUser.cloneMutable(); } - if(!capsReqUser.isOnscreen()) { + if( !this.capsReqUser.isOnscreen() ) { setShallUseOffscreenLayer(true); // trigger offscreen layer - if supported } if(null==device) { final GraphicsConfiguration gc = super.getGraphicsConfiguration(); if(null!=gc) { - device = gc.getDevice(); + this.device = gc.getDevice(); + } else { + this.device = null; } + } else { + this.device = device; } // instantiation will be issued in addNotify() - this.capsReqUser = capsReqUser; this.chooser = chooser; - if( null != shareWith ) { - helper.setSharedContext(null, shareWith); - } - this.device = device; this.addHierarchyListener(hierarchyListener); this.isShowing = isShowing(); diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java index eca99c6c0..549b6e96f 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java @@ -170,6 +170,10 @@ import com.jogamp.opengl.util.texture.TextureState; It is recommended to reset those states to default when leaving the {@link GLEventListener#display(GLAutoDrawable)} method! We may change this behavior in the future, i.e. preserve all influencing states. ++ See details about OpenGL context sharing. +
* @throws GLException if no default profile is available for the default desktop device. */ public GLJPanel() throws GLException { @@ -307,10 +314,13 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing /** Creates a new GLJPanel component with the requested set of OpenGL capabilities, using the default OpenGL capabilities selection mechanism. ++ See details about OpenGL context sharing. +
* @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device. */ public GLJPanel(final GLCapabilitiesImmutable userCapsRequest) throws GLException { - this(userCapsRequest, null, null); + this(userCapsRequest, null); } /** Creates a new GLJPanel component. The passed GLCapabilities @@ -319,33 +329,13 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing specifies the algorithm for selecting one of the available GLCapabilities for the component; a DefaultGLCapabilitesChooser is used if null is passed for this argument. ++ See details about OpenGL context sharing. +
* @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device. */ public GLJPanel(final GLCapabilitiesImmutable userCapsRequest, final GLCapabilitiesChooser chooser) throws GLException - { - this(userCapsRequest, chooser, null); - } - - /** Creates a new GLJPanel component. The passed GLCapabilities - specifies the OpenGL capabilities for the component; if null, a - default set of capabilities is used. The GLCapabilitiesChooser - specifies the algorithm for selecting one of the available - GLCapabilities for the component; a DefaultGLCapabilitesChooser - is used if null is passed for this argument. The passed - GLContext specifies an OpenGL context with which to share - textures, display lists and other OpenGL state, and may be null - if sharing is not desired. See the note in the overview documentation on - context sharing. -
- Note: Sharing cannot be enabled using J2D OpenGL FBO sharing,
- since J2D GL Context must be shared and we can only share one context.
- * @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device.
- * @deprecated Use {@link #GLJPanel(GLCapabilitiesImmutable, GLCapabilitiesChooser)}
- * and set shared GLContext via {@link #setSharedContext(GLContext)} or {@link #setSharedAutoDrawable(GLAutoDrawable)}.
- */
- public GLJPanel(final GLCapabilitiesImmutable userCapsRequest, final GLCapabilitiesChooser chooser, final GLContext shareWith)
- throws GLException
{
super();
@@ -366,9 +356,6 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
this.chooser = chooser;
helper = new GLDrawableHelper();
- if( null != shareWith ) {
- helper.setSharedContext(null, shareWith);
- }
autoSwapBufferMode = helper.getAutoSwapBufferMode();
this.setFocusable(true); // allow keyboard input!
diff --git a/src/jogl/classes/jogamp/opengl/GLBufferObjectTracker.java b/src/jogl/classes/jogamp/opengl/GLBufferObjectTracker.java
index 34857586d..7e49b3464 100644
--- a/src/jogl/classes/jogamp/opengl/GLBufferObjectTracker.java
+++ b/src/jogl/classes/jogamp/opengl/GLBufferObjectTracker.java
@@ -491,18 +491,6 @@ public class GLBufferObjectTracker {
return res;
}
- public synchronized final long getBufferSize(final int bufferName) {
- final GLBufferStorageImpl store = (GLBufferStorageImpl)bufferName2StorageMap.get(bufferName);
- if ( null == store ) {
- if (DEBUG) {
- System.err.printf("%s: %s.getBufferSize(): Buffer %d not tracked%n", warning, msgClazzName, bufferName);
- Thread.dumpStack();
- }
- return 0;
- }
- return store.getSize();
- }
-
public synchronized final GLBufferStorage getBufferStorage(final int bufferName) {
return (GLBufferStorageImpl)bufferName2StorageMap.get(bufferName);
}
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index ff4e9314f..c175243ae 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -2093,13 +2093,6 @@ public abstract class GLContextImpl extends GLContext {
return contextFQN;
}
- /** Indicates which floating-point pbuffer implementation is in
- use. Returns one of GLPbuffer.APPLE_FLOAT, GLPbuffer.ATI_FLOAT,
- or GLPbuffer.NV_FLOAT. */
- public int getFloatingPointMode() throws GLException {
- throw new GLException("Not supported on non-pbuffer contexts");
- }
-
@Override
public int getDefaultPixelDataType() {
evalPixelDataType();
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
index 1aca29d0a..0b119b50d 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
@@ -59,7 +59,6 @@ import javax.media.opengl.GLDrawableFactory;
import javax.media.opengl.GLException;
import javax.media.opengl.GLFBODrawable;
import javax.media.opengl.GLOffscreenAutoDrawable;
-import javax.media.opengl.GLPbuffer;
import javax.media.opengl.GLProfile;
import com.jogamp.nativewindow.MutableGraphicsConfiguration;
@@ -74,7 +73,6 @@ import com.jogamp.opengl.GLRendererQuirks;
Independent Bitmaps on Windows, pixmaps on X11). Direct access to
these GLDrawables is not supplied directly to end users, though
they may be instantiated by the GLJPanel implementation. */
-@SuppressWarnings("deprecation")
public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
protected static final boolean DEBUG = GLDrawableFactory.DEBUG; // allow package access
@@ -251,37 +249,6 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
@Override
public abstract boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp);
- @Override
- public final GLPbuffer createGLPbuffer(final AbstractGraphicsDevice deviceReq,
- final GLCapabilitiesImmutable capsRequested,
- final GLCapabilitiesChooser chooser,
- final int width,
- final int height,
- final GLContext shareWith) {
- if(width<=0 || height<=0) {
- throw new GLException("initial size must be positive (were (" + width + " x " + height + "))");
- }
- final AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
- if(null == device) {
- throw new GLException("No shared device for requested: "+deviceReq);
- }
- if ( !canCreateGLPbuffer(device, capsRequested.getGLProfile()) ) {
- throw new GLException("Pbuffer not available with device: "+device);
- }
-
- final GLCapabilitiesImmutable capsChosen = GLGraphicsConfigurationUtil.fixGLPBufferGLCapabilities(capsRequested);
- final GLDrawableImpl drawable = createOffscreenDrawableImpl( createMutableSurfaceImpl(device, true, capsChosen, capsRequested, chooser,
- new UpstreamSurfaceHookMutableSize(width, height) ) );
- final GLContextImpl ctx;
- if(null != drawable) {
- drawable.setRealized(true);
- ctx = (GLContextImpl) drawable.createContext(shareWith);
- } else {
- ctx = null;
- }
- return new GLPbufferImpl( drawable, ctx);
- }
-
//---------------------------------------------------------------------------
//
// Offscreen GLDrawable construction
@@ -296,21 +263,6 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
return GLContext.isFBOAvailable(device, glp);
}
- @Override
- public final GLOffscreenAutoDrawable createOffscreenAutoDrawable(final AbstractGraphicsDevice deviceReq,
- final GLCapabilitiesImmutable capsRequested,
- final GLCapabilitiesChooser chooser,
- final int width, final int height,
- final GLContext shareWith) {
- final GLDrawable drawable = createOffscreenDrawable( deviceReq, capsRequested, chooser, width, height );
- drawable.setRealized(true);
- final GLContext context = drawable.createContext(shareWith);
- if(drawable instanceof GLFBODrawableImpl) {
- return new GLOffscreenAutoDrawableImpl.FBOImpl( (GLFBODrawableImpl)drawable, context, null, null );
- }
- return new GLOffscreenAutoDrawableImpl( drawable, context, null, null);
- }
-
@Override
public final GLOffscreenAutoDrawable createOffscreenAutoDrawable(final AbstractGraphicsDevice deviceReq,
final GLCapabilitiesImmutable capsRequested,
diff --git a/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java b/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
deleted file mode 100644
index ac5487961..000000000
--- a/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * - Redistribution of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistribution in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- *
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package jogamp.opengl;
-
-import javax.media.opengl.GLDrawableFactory;
-import javax.media.opengl.GLException;
-import javax.media.opengl.GLPbuffer;
-
-import com.jogamp.common.util.locks.LockFactory;
-import com.jogamp.common.util.locks.RecursiveLock;
-
-@SuppressWarnings("deprecation")
-public class GLPbufferImpl extends GLAutoDrawableBase implements GLPbuffer {
-
- public GLPbufferImpl(final GLDrawableImpl pbufferDrawable, final GLContextImpl pbufferContext) {
- super(pbufferDrawable, pbufferContext, true); // drawable := pbufferDrawable, context := pbufferContext
- }
-
- //
- // pbuffer specifics
- //
-
- //
- // GLDrawable delegation
- //
-
- @Override
- public final void swapBuffers() throws GLException {
- defaultSwapBuffers();
- }
-
- //
- // GLAutoDrawable completion
- //
- private final RecursiveLock lock = LockFactory.createRecursiveLock(); // instance wide lock
-
- @Override
- protected final RecursiveLock getLock() { return lock; }
-
- @Override
- public final Object getUpstreamWidget() {
- return null;
- }
-
- @Override
- public void destroy() {
- defaultDestroy();
- }
-
- @Override
- public GLDrawableFactory getFactory() {
- return drawable.getFactory();
- }
-
- @Override
- public final void display() {
- final RecursiveLock _lock = lock;
- _lock.lock(); // sync: context/drawable could been recreated/destroyed while animating
- try {
- if( null != context ) {
- helper.invokeGL(drawable, context, defaultDisplayAction, defaultInitAction);
- }
- } finally {
- _lock.unlock();
- }
- }
-}
diff --git a/src/jogl/classes/jogamp/opengl/MemoryObject.java b/src/jogl/classes/jogamp/opengl/MemoryObject.java
deleted file mode 100644
index 942d62b9e..000000000
--- a/src/jogl/classes/jogamp/opengl/MemoryObject.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-
-package jogamp.opengl;
-
-import java.nio.ByteBuffer;
-import java.util.HashMap;
-
-import javax.media.opengl.GLBufferStorage;
-
-import com.jogamp.common.util.HashUtil;
-
-/**
- * @deprecated No more used for GL buffer storage tracking, see {@link GLBufferStorage} and {@link GLBufferObjectTracker}.
- */
-public class MemoryObject {
- private final long addr;
- private final long size;
- private final int hash;
- private ByteBuffer buffer=null;
- public MemoryObject(final long addr, final long size) {
- this.addr = addr;
- this.size = size;
- this.hash = HashUtil.getAddrSizeHash32_EqualDist(addr, size);
- }
-
- public void setBuffer(final ByteBuffer buffer) {
- this.buffer = buffer;
- }
-
- public ByteBuffer getBuffer() {
- return this.buffer;
- }
-
- /**
- * @return the 32bit hash value generated via {@link HashUtil#getAddrSizeHash32_EqualDist(long, long)}.
- */
- @Override
- public int hashCode() {
- return hash;
- }
-
- @Override
- public String toString() {
- return "MemoryObject[addr 0x"+Long.toHexString(addr)+", size 0x"+Long.toHexString(size)+", hash32: 0x"+Integer.toHexString(hash)+"]";
- }
-
- /**
- * Ignores the optional attached ByteBuffer
intentionally.
- *
- * @return true of reference is equal or obj
is of type MemoryObject
- * and addr
and size
is equal.
- */
- public boolean equals(final Object obj) {
- if(this == obj) { return true; }
- if(obj instanceof MemoryObject) {
- final MemoryObject m = (MemoryObject) obj;
- return addr == m.addr && size == m.size ;
- }
- return false;
- }
-
- /**
- * @param map the identity HashMap, MemoryObject to MemoryObject
- * @param obj0 the MemoryObject
- * @return either the already mapped MemoryObject - not changing the map, or the newly mapped one.
- */
- public static MemoryObject getOrAddSafe(final HashMap