summaryrefslogtreecommitdiffstats
path: root/src/newt
diff options
context:
space:
mode:
Diffstat (limited to 'src/newt')
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java29
-rw-r--r--src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java6
2 files changed, 30 insertions, 5 deletions
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index 7712b4654..3a49c06f0 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -51,6 +51,7 @@ import javax.media.opengl.*;
import jogamp.opengl.FPSCounterImpl;
import jogamp.opengl.GLDrawableHelper;
import com.jogamp.opengl.JoglVersion;
+import com.jogamp.opengl.util.Animator;
/**
* An implementation of {@link javax.media.opengl.GLAutoDrawable} interface,
@@ -539,14 +540,12 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC
}
}
- /** This implementation uses a static value */
- public void setAutoSwapBufferMode(boolean onOrOff) {
+ public void setAutoSwapBufferMode(boolean enable) {
if(null!=helper) {
- helper.setAutoSwapBufferMode(onOrOff);
+ helper.setAutoSwapBufferMode(enable);
}
}
- /** This implementation uses a static value */
public boolean getAutoSwapBufferMode() {
if(null!=helper) {
return helper.getAutoSwapBufferMode();
@@ -554,6 +553,28 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC
return false;
}
+ /**
+ * @param t the thread for which context release shall be skipped, usually the animation thread,
+ * ie. {@link Animator#getThread()}.
+ * @deprecated this is an experimental feature,
+ * intended for measuring performance in regards to GL context switch
+ */
+ public void setSkipContextReleaseThread(Thread t) {
+ if(null!=helper) {
+ helper.setSkipContextReleaseThread(t);
+ }
+ }
+
+ /**
+ * @deprecated see {@link #setSkipContextReleaseThread(Thread)}
+ */
+ public Thread getSkipContextReleaseThread() {
+ if(null!=helper) {
+ return helper.getSkipContextReleaseThread();
+ }
+ return null;
+ }
+
public void swapBuffers() {
if(drawable!=null && context != null) {
drawable.swapBuffers();
diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java b/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java
index 5e5b90770..bb678935a 100644
--- a/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java
+++ b/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java
@@ -81,6 +81,10 @@ public class NewtBaseActivity extends Activity {
public void setAnimator(Animator animator) {
this.animator = animator;
+ if(!animator.isStarted()) {
+ animator.start();
+ }
+ animator.pause();
}
@Override
@@ -127,7 +131,7 @@ public class NewtBaseActivity extends Activity {
super.onResume();
}
if(null != animator) {
- animator.start();
+ animator.resume();
}
}