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/javax | |
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/javax')
4 files changed, 12 insertions, 18 deletions
diff --git a/src/classes/javax/media/opengl/GLDrawable.java b/src/classes/javax/media/opengl/GLDrawable.java index f1468c475..39c7f96ca 100644 --- a/src/classes/javax/media/opengl/GLDrawable.java +++ b/src/classes/javax/media/opengl/GLDrawable.java @@ -110,11 +110,6 @@ public interface GLDrawable { */ public void destroy(); - /** Requests a new width and height for this GLDrawable. Not all - drawables are able to respond to this request and may silently - ignore it. */ - public void setSize(int width, int height); - /** Returns the current width of this GLDrawable. */ public int getWidth(); diff --git a/src/classes/javax/media/opengl/NativeWindow.java b/src/classes/javax/media/opengl/NativeWindow.java index f9785ccc6..a2a892d52 100644 --- a/src/classes/javax/media/opengl/NativeWindow.java +++ b/src/classes/javax/media/opengl/NativeWindow.java @@ -131,15 +131,9 @@ public interface NativeWindow { */ public boolean isTerminalObject(); - public void setSize(int width, int height); - public void setPosition(int x, int y); + /** Returns the current width of this window. */ public int getWidth(); - public int getHeight(); - public int getX(); - public int getY(); - public void setVisible(boolean visible); - public boolean setFullscreen(boolean fullscreen); - public boolean isVisible(); - public boolean isFullscreen(); + /** Returns the current height of this window. */ + public int getHeight(); } diff --git a/src/classes/javax/media/opengl/awt/AWTGLAutoDrawable.java b/src/classes/javax/media/opengl/awt/AWTGLAutoDrawable.java index 85163f0ff..d92cec389 100644 --- a/src/classes/javax/media/opengl/awt/AWTGLAutoDrawable.java +++ b/src/classes/javax/media/opengl/awt/AWTGLAutoDrawable.java @@ -43,6 +43,9 @@ import javax.media.opengl.*; import javax.media.opengl.glu.*; public interface AWTGLAutoDrawable extends GLAutoDrawable, ComponentEvents { + /** Requests a new width and height for this AWTGLAutoDrawable. */ + public void setSize(int width, int height); + /** Schedules a repaint of the component at some point in the future. */ public void repaint(); diff --git a/src/classes/javax/media/opengl/awt/GLJPanel.java b/src/classes/javax/media/opengl/awt/GLJPanel.java index c5877e5be..48a2c7cd9 100644 --- a/src/classes/javax/media/opengl/awt/GLJPanel.java +++ b/src/classes/javax/media/opengl/awt/GLJPanel.java @@ -786,8 +786,10 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { public void initialize() { // Fall-through path: create an offscreen context instead - offscreenDrawable = factory.createOffscreenDrawable(offscreenCaps, chooser); - offscreenDrawable.setSize(Math.max(1, panelWidth), Math.max(1, panelHeight)); + offscreenDrawable = factory.createOffscreenDrawable(offscreenCaps, + chooser, + Math.max(1, panelWidth), + Math.max(1, panelHeight)); offscreenContext = (GLContextImpl) offscreenDrawable.createContext(shareWith); offscreenContext.setSynchronized(true); isInitialized = true; @@ -820,8 +822,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { } public void handleReshape() { - offscreenContext.destroy(); - offscreenDrawable.setSize(Math.max(1, panelWidth), Math.max(1, panelHeight)); + destroy(); + initialize(); readBackWidthInPixels = Math.max(1, panelWidth); readBackHeightInPixels = Math.max(1, panelHeight); |