diff options
author | Sven Gothel <[email protected]> | 2012-06-27 05:40:32 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-06-27 05:40:32 +0200 |
commit | 4e2fb5389d22f2b16c1678843d4e31dd948c7902 (patch) | |
tree | 49df6dd262394b452877e9ec6a39e8a3a286b0bf /src/jogl/classes/jogamp/opengl/egl | |
parent | 1d9ce79f9e396599b2503f385c74bd132bf88fed (diff) |
Misc cleanup: Add @Override, remove trailing whitespace
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/egl')
4 files changed, 64 insertions, 43 deletions
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java index f5f9f62c4..06cd550b4 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2011 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 @@ -29,7 +29,7 @@ * 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. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -75,7 +75,8 @@ public abstract class EGLContext extends GLContextImpl { // no inner state _eglExt = null; super.resetStates(); } - + + @Override public Object getPlatformGLExtensions() { return getEGLExt(); } @@ -87,6 +88,7 @@ public abstract class EGLContext extends GLContextImpl { return _eglExt; } + @Override public final ProcAddressTable getPlatformExtProcAddressTable() { return eglExtProcAddressTable; } @@ -95,14 +97,18 @@ public abstract class EGLContext extends GLContextImpl { return eglExtProcAddressTable; } + @Override protected Map<String, String> getFunctionNameMap() { return null; } + @Override protected Map<String, String> getExtensionNameMap() { return null; } + @Override public final boolean isGLReadDrawableAvailable() { return true; } + @Override protected void makeCurrentImpl() throws GLException { if(EGL.EGL_NO_DISPLAY==((EGLDrawable)drawable).getDisplay() ) { throw new GLException("drawable not properly initialized, NO DISPLAY: "+drawable); @@ -118,6 +124,7 @@ public abstract class EGLContext extends GLContextImpl { } } + @Override protected void releaseImpl() throws GLException { if (!EGL.eglMakeCurrent(((EGLDrawable)drawable).getDisplay(), EGL.EGL_NO_SURFACE, @@ -128,6 +135,7 @@ public abstract class EGLContext extends GLContextImpl { } } + @Override protected void destroyImpl() throws GLException { if (!EGL.eglDestroyContext(((EGLDrawable)drawable).getDisplay(), contextHandle)) { final int eglError = EGL.eglGetError(); @@ -138,14 +146,17 @@ public abstract class EGLContext extends GLContextImpl { } } + @Override protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) { return 0; // FIXME } + @Override protected void destroyContextARBImpl(long _context) { // FIXME } + @Override protected boolean createImpl(GLContextImpl shareWith) throws GLException { long eglDisplay = ((EGLDrawable)drawable).getDisplay(); EGLGraphicsConfiguration config = ((EGLDrawable)drawable).getGraphicsConfiguration(); @@ -178,7 +189,7 @@ public abstract class EGLContext extends GLContextImpl { } } - final IntBuffer contextAttrsNIO; + final IntBuffer contextAttrsNIO; { final int[] contextAttrs = new int[] { EGL.EGL_CONTEXT_CLIENT_VERSION, -1, @@ -200,7 +211,7 @@ public abstract class EGLContext extends GLContextImpl { } if (DEBUG) { System.err.println(getThreadName() + ": Created OpenGL context 0x" + - Long.toHexString(contextHandle) + + Long.toHexString(contextHandle) + ",\n\twrite surface 0x" + Long.toHexString(drawable.getHandle()) + ",\n\tread surface 0x" + Long.toHexString(drawableRead.getHandle())+ ",\n\t"+this+ @@ -218,13 +229,14 @@ public abstract class EGLContext extends GLContextImpl { if(glProfile.usesNativeGLES2()) { ctp |= CTX_IMPL_ES2_COMPAT; major = 2; - } else { + } else { major = 1; } setGLFunctionAvailability(true, major, 0, ctp); return true; } + @Override protected final void updateGLXProcAddressTable() { final AbstractGraphicsConfiguration aconfig = drawable.getNativeSurface().getGraphicsConfiguration(); final AbstractGraphicsDevice adevice = aconfig.getScreen().getDevice(); @@ -255,16 +267,17 @@ public abstract class EGLContext extends GLContextImpl { } } } - + + @Override protected final StringBuilder getPlatformExtensionsStringImpl() { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); if (!eglQueryStringInitialized) { eglQueryStringAvailable = getDrawableImpl().getGLDynamicLookupHelper().dynamicLookupFunction("eglQueryString") != 0; eglQueryStringInitialized = true; } if (eglQueryStringAvailable) { - final String ret = EGL.eglQueryString(((EGLDrawable)drawable).getDisplay(), + final String ret = EGL.eglQueryString(((EGLDrawable)drawable).getDisplay(), EGL.EGL_EXTENSIONS); if (DEBUG) { System.err.println("EGL extensions: " + ret); @@ -289,8 +302,10 @@ public abstract class EGLContext extends GLContextImpl { return EGL.eglSwapInterval(((EGLDrawable)drawable).getDisplay(), interval); } + @Override public abstract void bindPbufferToTexture(); + @Override public abstract void releasePbufferFromTexture(); protected static String toHexString(int hex) { @@ -299,24 +314,28 @@ public abstract class EGLContext extends GLContextImpl { protected static String toHexString(long hex) { return GLContext.toHexString(hex); } - + //---------------------------------------------------------------------- // Currently unimplemented stuff // + @Override protected void copyImpl(GLContext source, int mask) throws GLException { throw new GLException("Not yet implemented"); } + @Override public ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) { throw new GLException("Should not call this"); } + @Override public boolean offscreenImageNeedsVerticalFlip() { throw new GLException("Should not call this"); } + @Override public int getOffscreenContextPixelDataType() { throw new GLException("Should not call this"); } diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java index ff60a5262..0a451e5eb 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2008 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 @@ -28,7 +28,7 @@ * 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. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -49,6 +49,7 @@ public class EGLExternalContext extends EGLContext { getGLStateTracker().setEnabled(false); // external context usage can't track state in Java } + @Override public int makeCurrent() throws GLException { // Save last context if necessary to allow external GLContexts to // talk to other GLContexts created by this library @@ -58,27 +59,33 @@ public class EGLExternalContext extends EGLContext { setCurrent(null); } return super.makeCurrent(); - } + } + @Override public void release() throws GLException { super.release(); setCurrent(lastContext); lastContext = null; } + @Override protected void makeCurrentImpl() throws GLException { } + @Override protected void releaseImpl() throws GLException { } + @Override protected void destroyImpl() throws GLException { } + @Override public void bindPbufferToTexture() { throw new GLException("Should not call this"); } + @Override public void releasePbufferFromTexture() { throw new GLException("Should not call this"); } diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenContext.java index dd0a3db3a..eae47fa92 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenContext.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenContext.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2008 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 @@ -28,29 +28,26 @@ * 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. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ package jogamp.opengl.egl; -import javax.media.nativewindow.*; import javax.media.opengl.*; -import jogamp.opengl.*; -import com.jogamp.gluegen.runtime.ProcAddressTable; -import java.nio.*; -import java.util.*; public class EGLOnscreenContext extends EGLContext { public EGLOnscreenContext(EGLOnscreenDrawable drawable, GLContext shareWith) { super(drawable, shareWith); } + @Override public void bindPbufferToTexture() { throw new GLException("Should not call this"); } + @Override public void releasePbufferFromTexture() { throw new GLException("Should not call this"); } diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLPbufferContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLPbufferContext.java index 2cad7daac..7175d516f 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLPbufferContext.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLPbufferContext.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2008 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 @@ -28,33 +28,31 @@ * 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. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ package jogamp.opengl.egl; -import javax.media.nativewindow.*; import javax.media.opengl.*; -import jogamp.opengl.*; -import com.jogamp.gluegen.runtime.ProcAddressTable; -import java.nio.*; -import java.util.*; public class EGLPbufferContext extends EGLContext { public EGLPbufferContext(EGLPbufferDrawable drawable, GLContext shareWith) { super(drawable, shareWith); } + @Override public int getFloatingPointMode() { return 0; // FIXME ?? } + @Override public void bindPbufferToTexture() { throw new GLException("Not yet implemented"); } + @Override public void releasePbufferFromTexture() { throw new GLException("Not yet implemented"); } |