diff options
Diffstat (limited to 'src/classes/javax/media/opengl')
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); |