diff options
author | Kenneth Russel <[email protected]> | 2008-12-16 02:38:46 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2008-12-16 02:38:46 +0000 |
commit | 14a94c810910f88d3b7214ae9be5027dc74df39f (patch) | |
tree | 35792a840d433342d190e1838c456c3242b39295 /src/classes/com/sun/opengl/impl/windows | |
parent | 06d146fc64d934039e55a2c00a18e1056e0d85f2 (diff) |
Removed setSize(), setPosition(), setVisible(), and setFullscreen()
from javax.media.opengl.NativeWindow interface as these are concerns
of the window toolkit and not the OpenGL binding. Removed isVisible(),
isFullscreen(), getX(), and getY(). getWidth() and getHeight() remain.
Changed implementations of offscreen and pbuffer drawables and changed
GLJPanel to destroy and re-create its offscreen GLDrawable upon resize
rather than attempting to resize the GLDrawable directly.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1823 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl/impl/windows')
4 files changed, 15 insertions, 27 deletions
diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java index 8dded7069..38215fd46 100644 --- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java +++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java @@ -48,20 +48,18 @@ public class WindowsOffscreenWGLDrawable extends WindowsWGLDrawable { public WindowsOffscreenWGLDrawable(GLDrawableFactory factory, GLCapabilities requestedCapabilities, - GLCapabilitiesChooser chooser) { + GLCapabilitiesChooser chooser, + int width, + int height) { super(factory, new NullWindow(), true, requestedCapabilities, chooser); + ((NullWindow) getNativeWindow()).setSize(width, height); + create(); } public GLContext createContext(GLContext shareWith) { return new WindowsOffscreenWGLContext(this, shareWith); } - public void setSize(int newWidth, int newHeight) { - super.setSize(newWidth, newHeight); - destroy(); - create(); - } - private void create() { getFactoryImpl().lockToolkit(); try { diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java index 145858d5d..52812f0e9 100644 --- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java +++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java @@ -62,10 +62,6 @@ public class WindowsOnscreenWGLDrawable extends WindowsWGLDrawable { return new WindowsOnscreenWGLContext(this, shareWith); } - public void setSize(int width, int height) { - component.setSize(width, height); - } - public int getWidth() { return component.getWidth(); } diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java index 40e46a232..f82653bcd 100644 --- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java +++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java @@ -52,17 +52,17 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable { public WindowsPbufferWGLDrawable(GLDrawableFactory factory, GLCapabilities requestedCapabilities, - int initialWidth, - int initialHeight, + int width, + int height, WindowsWGLDrawable dummyDrawable, WGLExt wglExt) { super(factory, new NullWindow(), true, requestedCapabilities, null); - if (initialWidth <= 0 || initialHeight <= 0) { - throw new GLException("Initial width and height of pbuffer must be positive (were (" + - initialWidth + ", " + initialHeight + "))"); + if (width <= 0 || height <= 0) { + throw new GLException("Width and height of pbuffer must be positive (were (" + + width + ", " + height + "))"); } NullWindow nw = (NullWindow) getNativeWindow(); - nw.setSize(initialWidth, initialHeight); + nw.setSize(width, height); if (DEBUG) { System.out.println("Pbuffer caps on init: " + requestedCapabilities + @@ -104,14 +104,6 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable { super.destroy(); } - public void setSize(int newWidth, int newHeight) { - super.setSize(newWidth, newHeight); - destroy(); - if(cachedParentHdc!=0 && cachedWGLExt!=null) { - createPbuffer(cachedParentHdc, cachedWGLExt); - } - } - public long getPbuffer() { return buffer; } diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java index 762714690..4fe0900a6 100644 --- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java +++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java @@ -80,8 +80,10 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl { } public GLDrawableImpl createOffscreenDrawable(GLCapabilities capabilities, - GLCapabilitiesChooser chooser) { - return new WindowsOffscreenWGLDrawable(this, capabilities, chooser); + GLCapabilitiesChooser chooser, + int width, + int height) { + return new WindowsOffscreenWGLDrawable(this, capabilities, chooser, width, height); } private boolean pbufferSupportInitialized = false; |