diff options
author | Kenneth Russel <[email protected]> | 2005-05-24 22:01:07 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-05-24 22:01:07 +0000 |
commit | 21fae330fcf16b84233fd8b4e4ce6bef91db1208 (patch) | |
tree | 847bfd45e3e0248ff951f5f7bd47c47fe65a6ebc /src | |
parent | e55e12f14ce0dbdec57ef64efc77da0c8e590fe2 (diff) |
Added more documentation about behavior of GLEventListener.init() and
GLJPanel resize operations
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@280 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src')
-rw-r--r-- | src/net/java/games/jogl/GLEventListener.java | 8 | ||||
-rw-r--r-- | src/net/java/games/jogl/GLJPanel.java | 13 |
2 files changed, 18 insertions, 3 deletions
diff --git a/src/net/java/games/jogl/GLEventListener.java b/src/net/java/games/jogl/GLEventListener.java index 8a768af87..eca1a0649 100644 --- a/src/net/java/games/jogl/GLEventListener.java +++ b/src/net/java/games/jogl/GLEventListener.java @@ -48,8 +48,12 @@ import java.util.EventListener; public interface GLEventListener extends EventListener { /** Called by the drawable immediately after the OpenGL context is - initialized for the first time. Can be used to perform one-time - OpenGL initialization such as setup of lights and display lists. + initialized. Can be used to perform one-time OpenGL + initialization such as setup of lights and display lists. Note + that this method may be called more than once if the underlying + OpenGL context for the GLDrawable is destroyed and recreated, + for example if a GLCanvas is removed from the widget hierarchy + and later added again. */ public void init(GLDrawable drawable); diff --git a/src/net/java/games/jogl/GLJPanel.java b/src/net/java/games/jogl/GLJPanel.java index 8b0c9f383..761843d75 100644 --- a/src/net/java/games/jogl/GLJPanel.java +++ b/src/net/java/games/jogl/GLJPanel.java @@ -64,7 +64,18 @@ import net.java.games.jogl.impl.*; use hardware-accelerated rendering via pbuffers and falls back on to software rendering if problems occur. This class can not be instantiated directly; use {@link GLDrawableFactory} to construct - them. */ + them. <P> + + Note that because this component attempts to use pbuffers for + rendering, and because pbuffers can not be resized, somewhat + surprising behavior may occur during resize operations; the {@link + GLEventListener#init} method may be called multiple times as the + pbuffer is resized to be able to cover the size of the GLJPanel. + This behavior is correct, as the textures and display lists for + the GLJPanel will have been lost during the resize operation. The + application should attempt to make its GLEventListener.init() + methods as side-effect-free as possible. +*/ public final class GLJPanel extends JPanel implements GLDrawable { protected static final boolean DEBUG = Debug.debug("GLJPanel"); |