summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-07-10 01:11:00 +0200
committerSven Gothel <[email protected]>2014-07-10 01:11:00 +0200
commitec2d94ca26ddab8ec67135ebc5f2d0a43f6a4c25 (patch)
treee405f17400b8d52ffe38347d226ca9927ac4f3ec /src/jogl/classes/jogamp/opengl
parentefa5f1110725d41b7ea58010fe34b2a8aacd185b (diff)
Bug 1031: Remove Deprecated Classes and Methods (JOGL)
Removed Deprecated Class: - com/jogamp/opengl/util/TGAWriter.java - Use TextureIO w/ .tga suffix - com/jogamp/opengl/util/awt/Screenshot.java - Use: - com.jogamp.opengl.util.GLReadBufferUtil, or - com.jogamp.opengl.util.awt.AWTGLReadBufferUtil The latter for reading into AWT BufferedImage See: TestBug461FBOSupersamplingSwingAWT, TestBug605FlippedImageAWT - javax/media/opengl/GLPbuffer.java - Use: caps.setPBuffer(true); final GLAutoDrawable pbuffer = GLDrawableFactory.getFactory( caps.getGLProfile() ).createOffscreenAutoDrawable(null, caps, null, 512, 512); - See: TestPBufferDeadlockAWT, .. Removed Deprecated Methods: - Constructor of AWT-GLCanvas, SWT-GLCanvas, AWT-GLJPanel with argument 'final GLContext shareWith' See GLSharedContextSetter, i.e. glCanvas.setSharedContext(..) ! - GLDrawableFactory.createOffscreenAutoDrawable(..) with argument 'final GLContext shareWith' See GLSharedContextSetter, i.e. offscreenAutoDrawable.setSharedContext(..) ! - GLDrawableFactory.createGLPbuffer(..), see above! - com.jogamp.opengl.util.av.AudioSink 'enqueueData(AudioDataFrame audioDataFrame)', use 'enqueueData(int, ByteBuffer, int)' - GLSharedContextSetter.areAllGLEventListenerInitialized(), migrated to GLAutoDrawable ! - GLBase's - glGetBoundBuffer(int), use getBoundBuffer(int) - glGetBufferSize(int), use getBufferStorage(int).getSize() - glIsVBOArrayBound(), use isVBOArrayBound() - glIsVBOElementArrayBound(), use isVBOElementArrayBound() - NEWT MouseEvent.BUTTON_NUMBER, use BUTTON_COUNT
Diffstat (limited to 'src/jogl/classes/jogamp/opengl')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLBufferObjectTracker.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/GLContextImpl.java7
-rw-r--r--src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java48
-rw-r--r--src/jogl/classes/jogamp/opengl/GLPbufferImpl.java105
-rw-r--r--src/jogl/classes/jogamp/opengl/MemoryObject.java103
-rw-r--r--src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java5
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java22
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java5
8 files changed, 8 insertions, 299 deletions
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
@@ -300,21 +267,6 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
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,
- final GLCapabilitiesChooser chooser,
final int width, final int height) {
final GLDrawable drawable = createOffscreenDrawable( deviceReq, capsRequested, chooser, width, height );
drawable.setRealized(true);
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 <code>ByteBuffer</code> intentionally.<br>
- *
- * @return true of reference is equal or <code>obj</code> is of type <code>MemoryObject</code>
- * and <code>addr</code> and <code>size</code> is equal.<br>
- */
- 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<MemoryObject,MemoryObject> map, final MemoryObject obj0) {
- final MemoryObject obj1 = map.get(obj0); // get identity (fast)
- if(null == obj1) {
- map.put(obj0, obj0);
- return obj0;
- } else {
- return obj1;
- }
- }
-
-} \ No newline at end of file
diff --git a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
index 330c4f044..003b9148e 100644
--- a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
@@ -673,11 +673,6 @@ public class ALAudioSink implements AudioSink {
}
@Override
- public final AudioFrame enqueueData(final AudioDataFrame audioDataFrame) {
- return enqueueData(audioDataFrame.getPTS(), audioDataFrame.getData(), audioDataFrame.getByteSize());
- }
-
- @Override
public final AudioFrame enqueueData(final int pts, final ByteBuffer bytes, final int byteCount) {
if( !initialized || null == chosenFormat ) {
return null;
diff --git a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
index a24e77b7d..117be5489 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
@@ -186,28 +186,22 @@ public class JavaSoundAudioSink implements AudioSink {
}
@Override
- public AudioFrame enqueueData(final AudioDataFrame audioDataFrame) {
- int byteSize = audioDataFrame.getByteSize();
- final ByteBuffer byteBuffer = audioDataFrame.getData();
- final byte[] bytes = new byte[byteSize];
+ public AudioFrame enqueueData(final int pts, final ByteBuffer byteBuffer, final int byteCount) {
+ final byte[] bytes = new byte[byteCount];
final int p = byteBuffer.position();
- byteBuffer.get(bytes, 0, byteSize);
+ byteBuffer.get(bytes, 0, byteCount);
byteBuffer.position(p);
int written = 0;
int len;
- while (byteSize > 0) {
- len = auline.write(bytes, written, byteSize);
- byteSize -= len;
+ int bytesLeft = byteCount;
+ while (bytesLeft > 0) {
+ len = auline.write(bytes, written, byteCount);
+ bytesLeft -= len;
written += len;
}
playImpl();
- return audioDataFrame;
- }
-
- @Override
- public AudioFrame enqueueData(final int pts, final ByteBuffer bytes, final int byteCount) {
- return enqueueData(new AudioDataFrame(pts, chosenFormat.getBytesDuration(byteCount), bytes, byteCount));
+ return new AudioDataFrame(pts, chosenFormat.getBytesDuration(byteCount), byteBuffer, byteCount);
}
@Override
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
index 3aa9d7ab6..7e27f17c3 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
@@ -171,11 +171,6 @@ public class NullAudioSink implements AudioSink {
}
@Override
- public AudioFrame enqueueData(final AudioDataFrame audioDataFrame) {
- return enqueueData(audioDataFrame.getPTS(), audioDataFrame.getData(), audioDataFrame.getByteSize());
- }
-
- @Override
public AudioFrame enqueueData(final int pts, final ByteBuffer bytes, final int byteCount) {
if( !initialized || null == chosenFormat ) {
return null;