diff options
author | Sven Gothel <[email protected]> | 2010-09-15 00:43:27 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-09-15 00:43:27 +0200 |
commit | dc9191f1733960d8a035b5fb8c5f8314f54a0ca7 (patch) | |
tree | 601b6526b1ffe66eee87efb3ad206195c64b1d57 /src/jogl/classes | |
parent | 579754592a8bb9175ea49f983c8f2b58c448d317 (diff) |
Misc Cleanups
- www/index.html: absolute local refs -> relative
- Platform GLContextImpl specialisations: remove local overriding drawable instance
- X11ExternalGLXDrawable: Remove dead code, left over.
Diffstat (limited to 'src/jogl/classes')
8 files changed, 16 insertions, 38 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java index 258445ce2..c19871560 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java @@ -492,11 +492,11 @@ public abstract class GLContextImpl extends GLContext { if (!mappedVersionsAvailableSet) { synchronized (mappedVersionsAvailableLock) { if (!mappedVersionsAvailableSet) { - createContextARBMapVersionsAvailable(4, false); // GL4 - createContextARBMapVersionsAvailable(4, true); // GL4bc - createContextARBMapVersionsAvailable(3, false); // GL3 - createContextARBMapVersionsAvailable(3, true); // GL3bc - createContextARBMapVersionsAvailable(2, true); // GL2 + createContextARBMapVersionsAvailable(4, false /* core */); // GL4 + createContextARBMapVersionsAvailable(4, true /* compat */); // GL4bc + createContextARBMapVersionsAvailable(3, false /* core */); // GL3 + createContextARBMapVersionsAvailable(3, true /* compat */); // GL3bc + createContextARBMapVersionsAvailable(2, true /* compat */); // GL2 mappedVersionsAvailableSet = true; if (DEBUG) { System.err.println(getThreadName() + ": !!! createContextARB: SET mappedVersionsAvailableSet " + mappedVersionsAvailableSet); diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java index 568204384..e494fd121 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java @@ -46,12 +46,10 @@ import javax.media.opengl.*; import com.jogamp.opengl.impl.*; public class MacOSXOnscreenCGLContext extends MacOSXCGLContext { - protected MacOSXOnscreenCGLDrawable drawable; public MacOSXOnscreenCGLContext(MacOSXOnscreenCGLDrawable drawable, GLContext shareWith) { super(drawable, shareWith); - this.drawable = drawable; } protected void makeCurrentImpl(boolean newCreated) throws GLException { diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java index 9c630d24b..3964c9771 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java @@ -9,7 +9,6 @@ import javax.media.nativewindow.*; import com.jogamp.opengl.impl.*; public class MacOSXPbufferCGLContext extends MacOSXCGLContext { - protected MacOSXPbufferCGLDrawable drawable; // State for render-to-texture and render-to-texture-rectangle support private int textureTarget; // e.g. GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_NV @@ -28,7 +27,6 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext { public MacOSXPbufferCGLContext(MacOSXPbufferCGLDrawable drawable, GLContext shareWith) { super(drawable, shareWith); - this.drawable = drawable; initOpenGLImpl(); } @@ -45,8 +43,8 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext { } protected void makeCurrentImpl(boolean newCreated) throws GLException { - if (getOpenGLMode() != drawable.getOpenGLMode()) { - setOpenGLMode(drawable.getOpenGLMode()); + if (getOpenGLMode() != ((MacOSXPbufferCGLDrawable)drawable).getOpenGLMode()) { + setOpenGLMode(((MacOSXPbufferCGLDrawable)drawable).getOpenGLMode()); } if (!impl.makeCurrent(contextHandle)) { @@ -149,7 +147,7 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext { throw new GLException("Can't switch between using NSOpenGLPixelBuffer and CGLPBufferObj more than once"); } destroyImpl(); - drawable.setOpenGLMode(mode); + ((MacOSXPbufferCGLDrawable)drawable).setOpenGLMode(mode); openGLMode = mode; haveSetOpenGLMode = true; if (DEBUG) { diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java index 1da5b80c9..66953289b 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java @@ -46,7 +46,6 @@ public class WindowsPbufferWGLContext extends WindowsWGLContext { private static final boolean DEBUG = Debug.debug("WindowsPbufferWGLContext"); // State for render-to-texture and render-to-texture-rectangle support - private WindowsPbufferWGLDrawable drawable; private boolean rtt; // render-to-texture? private boolean hasRTT; // render-to-texture extension available? private boolean rect; // render-to-texture-rectangle? @@ -56,7 +55,6 @@ public class WindowsPbufferWGLContext extends WindowsWGLContext { public WindowsPbufferWGLContext(WindowsPbufferWGLDrawable drawable, GLContext shareWith) { super(drawable, shareWith); - this.drawable = drawable; } public void bindPbufferToTexture() { @@ -68,7 +66,7 @@ public class WindowsPbufferWGLContext extends WindowsWGLContext { WGLExt wglExt = getWGLExt(); gl.glBindTexture(textureTarget, texture); if (rtt && hasRTT) { - if (!wglExt.wglBindTexImageARB(drawable.getPbufferHandle(), WGLExt.WGL_FRONT_LEFT_ARB)) { + if (!wglExt.wglBindTexImageARB(((WindowsPbufferWGLDrawable)drawable).getPbufferHandle(), WGLExt.WGL_FRONT_LEFT_ARB)) { throw new GLException("Binding of pbuffer to texture failed: " + wglGetLastError()); } } @@ -84,7 +82,7 @@ public class WindowsPbufferWGLContext extends WindowsWGLContext { } if (rtt && hasRTT) { WGLExt wglExt = getWGLExt(); - if (!wglExt.wglReleaseTexImageARB(drawable.getPbufferHandle(), WGLExt.WGL_FRONT_LEFT_ARB)) { + if (!wglExt.wglReleaseTexImageARB(((WindowsPbufferWGLDrawable)drawable).getPbufferHandle(), WGLExt.WGL_FRONT_LEFT_ARB)) { throw new GLException("Releasing of pbuffer from texture failed: " + wglGetLastError()); } } @@ -142,7 +140,7 @@ public class WindowsPbufferWGLContext extends WindowsWGLContext { } public int getFloatingPointMode() { - return drawable.getFloatingPointMode(); + return ((WindowsPbufferWGLDrawable)drawable).getFloatingPointMode(); } private static String wglGetLastError() { diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXDrawable.java index 006a55e20..d930179df 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXDrawable.java @@ -47,19 +47,8 @@ import com.jogamp.nativewindow.impl.NullWindow; public class X11ExternalGLXDrawable extends X11GLXDrawable { - //TODO? those are not used -// private int fbConfigID; -// private int renderType; - - private X11ExternalGLXDrawable(GLDrawableFactory factory, NativeWindow component, int renderType) { + private X11ExternalGLXDrawable(GLDrawableFactory factory, NativeWindow component) { super(factory, component, true); - -// this.renderType = renderType; - - // Need GLXFBConfig ID in order to properly create new contexts - // on this drawable -// X11GLXGraphicsConfiguration cfg = (X11GLXGraphicsConfiguration) component.getGraphicsConfiguration(); -// fbConfigID = cfg.getFBConfigID(); } protected static X11ExternalGLXDrawable create(GLDrawableFactory factory, GLProfile glp) { @@ -97,7 +86,7 @@ public class X11ExternalGLXDrawable extends X11GLXDrawable { NullWindow nw = new NullWindow(cfg); nw.setSurfaceHandle(drawable); nw.setSize(w, h); - return new X11ExternalGLXDrawable(factory, nw, GLX.GLX_RGBA_TYPE); + return new X11ExternalGLXDrawable(factory, nw); } public GLContext createContext(GLContext shareWith) { diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java index 8fcc7994b..9884db288 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java @@ -132,7 +132,6 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac } GLCapabilities caps2 = (GLCapabilities) capabilities.clone(); - GLCapabilitiesChooser glChooser = chooser; boolean usePBuffer = caps2.isPBuffer(); @@ -141,12 +140,12 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac caps2.setDoubleBuffered(false); } - X11GLXGraphicsConfiguration res = chooseGraphicsConfigurationFBConfig(caps2, glChooser, x11Screen); + X11GLXGraphicsConfiguration res = chooseGraphicsConfigurationFBConfig(caps2, chooser, x11Screen); if(null==res) { if(usePBuffer) { throw new GLException("Error: Couldn't create X11GLXGraphicsConfiguration based on FBConfig for "+caps2); } - res = chooseGraphicsConfigurationXVisual(caps2, glChooser, x11Screen); + res = chooseGraphicsConfigurationXVisual(caps2, chooser, x11Screen); } if(null==res) { throw new GLException("Error: Couldn't create X11GLXGraphicsConfiguration based on FBConfig and XVisual for "+caps2); diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXContext.java index f3674c108..6f24d5a60 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXContext.java @@ -42,12 +42,10 @@ package com.jogamp.opengl.impl.x11.glx; import javax.media.opengl.*; public class X11OffscreenGLXContext extends X11GLXContext { - private X11OffscreenGLXDrawable drawable; public X11OffscreenGLXContext(X11OffscreenGLXDrawable drawable, GLContext shareWith) { super(drawable, shareWith); - this.drawable = drawable; } public int getOffscreenContextPixelDataType() { diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXContext.java index 8d118f2df..85bbade24 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXContext.java @@ -42,11 +42,9 @@ package com.jogamp.opengl.impl.x11.glx; import javax.media.opengl.*; public class X11PbufferGLXContext extends X11GLXContext { - private X11PbufferGLXDrawable drawable; public X11PbufferGLXContext(X11PbufferGLXDrawable drawable, GLContext shareWith) { super(drawable, shareWith); - this.drawable = drawable; } public void bindPbufferToTexture() { @@ -61,7 +59,7 @@ public class X11PbufferGLXContext extends X11GLXContext { public int getFloatingPointMode() { - return drawable.getFloatingPointMode(); + return ((X11PbufferGLXDrawable)drawable).getFloatingPointMode(); } protected boolean createImpl() { |