diff options
author | Sven Gothel <[email protected]> | 2009-10-05 02:54:59 -0700 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2009-10-05 02:54:59 -0700 |
commit | 76bf2e5a7f23def0a3bf2b688791b593ecb283ab (patch) | |
tree | 84b7b2a25cc38450dc83a78d1f1ed165195a599e /src/jogl/classes/javax/media/opengl/awt | |
parent | 59257476777104ff3f117d87a8205161cb800abf (diff) |
GLDrawableFactory Cleanup (-> On- Offscreen and PBuffer)
- Base all PBuffer/Offscreen GLDrawable creators on
a prev. created 'NativeWindow + SurfaceChangeable' instance.
Simplifies implementation path.
This also removes the almost cyclic referencing of
GLWindow -> OffscreenWindow
GLWindow -> Drawable -> NullWindow -> OffscreenWindow
Now it is just
GLWindow -> OffscreenWindow
GLWindow -> Drawable -> OffscreenWindow
- createGLDrawable() shall be used for all types now,
especially if you want to pass the offscreen NativeWindow
and benefit from the surfaceChangedListener etc ..
- Add public createOffscreenDrawable(..)
- EGLDrawable:
- Query surface only if not 0
- [re]create surface only if needed,
using 'ownEGL*' flag for destruction only.
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/awt')
-rw-r--r-- | src/jogl/classes/javax/media/opengl/awt/GLJPanel.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java index fe55b2dbd..e4758211e 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java @@ -909,10 +909,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { public void initialize() { // Fall-through path: create an offscreen context instead - offscreenDrawable = factory.createOffscreenDrawable(offscreenCaps, - chooser, - Math.max(1, panelWidth), - Math.max(1, panelHeight)); + offscreenDrawable = (GLDrawableImpl) factory.createOffscreenDrawable( + offscreenCaps, + chooser, + Math.max(1, panelWidth), + Math.max(1, panelHeight)); offscreenContext = (GLContextImpl) offscreenDrawable.createContext(shareWith); offscreenContext.setSynchronized(true); isInitialized = true; |