added requestFocus() to PGraphicsOpenGL, PGL

This commit is contained in:
codeanticode
2013-06-03 13:44:22 -04:00
parent 22b37fa967
commit 0f35afcb27
2 changed files with 14 additions and 4 deletions

View File

@@ -569,8 +569,6 @@ public class PGL {
listener = new PGLListener();
canvasAWT.addGLEventListener(listener);
canvasAWT.requestFocus();
} else if (WINDOW_TOOLKIT == NEWT) {
window = GLWindow.create(caps);
if (sharedCtx != null) {
@@ -601,8 +599,6 @@ public class PGL {
listener = new PGLListener();
window.addGLEventListener(listener);
canvasNEWT.requestFocus();
}
fboLayerCreated = false;
@@ -1135,6 +1131,14 @@ public class PGL {
}
protected void requestFocus() {
if (canvas != null) {
System.out.println("request focus for the GL canvas");
canvas.requestFocus();
}
}
protected boolean canDraw() {
return pg.initialized && pg.parent.isDisplayable();
}