summaryrefslogtreecommitdiffstats
path: root/src/net/java/games/jogl/GLJPanel.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/java/games/jogl/GLJPanel.java')
-rw-r--r--src/net/java/games/jogl/GLJPanel.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/net/java/games/jogl/GLJPanel.java b/src/net/java/games/jogl/GLJPanel.java
index d21081dfe..bf102710b 100644
--- a/src/net/java/games/jogl/GLJPanel.java
+++ b/src/net/java/games/jogl/GLJPanel.java
@@ -291,17 +291,27 @@ public final class GLJPanel extends JPanel implements GLDrawable {
public GL getGL() {
if (!hardwareAccelerationDisabled) {
+ if (pbuffer == null) {
+ return null;
+ }
return pbuffer.getGL();
} else {
+ if (offscreenContext == null) {
+ return null;
+ }
return offscreenContext.getGL();
}
}
public void setGL(GL gl) {
if (!hardwareAccelerationDisabled) {
- pbuffer.setGL(gl);
+ if (pbuffer != null) {
+ pbuffer.setGL(gl);
+ }
} else {
- offscreenContext.setGL(gl);
+ if (offscreenContext != null) {
+ offscreenContext.setGL(gl);
+ }
}
}
@@ -473,6 +483,9 @@ public final class GLJPanel extends JPanel implements GLDrawable {
public void init(GLDrawable drawable) {
if (!hardwareAccelerationDisabled) {
+ if (DEBUG) {
+ System.err.println("GLJPanel$Updater.init(): pbufferInitializationCompleted = true");
+ }
pbufferInitializationCompleted = true;
EventQueue.invokeLater(new Runnable() {
public void run() {