From 554ec0576432194f050191bdf248a1462d542a6d Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 27 Aug 2013 19:21:17 +0200 Subject: GLMediaPlayer: Add camera input / FFMPEG: Fix 'av_packet' leak and add missing symbol 'av_realloc'. - Add camera input - Use URI w/ scheme 'camera' to determine camera input is desired, use URI host as camera id. E.g. 'camera://0' for 1st camera. - AndroidGLMediaPlayerAPI14: Via 'Camera' - FFMPEG*: Via libavdevice, device name and input format - TODO: Add controls to manipulate camera if available - FFMPEG* - Add symbols - avcodec_register_all - av_realloc (was missing) - avdevice_register_all - Load libavdevice (opt) - Camera: - Use (windows) and /dev/video other OS - simply find the input format in native code - Support YUYV422 (used in video4linux2, etc.) - Stuff 2x 16bpp (YUYV) into one RGBA pixel! - Add texture format for 16bpp - Add texture lookup shader - Fix av_packet leak in readNextImpl(..) - Restore orig pointer and size values, we may have moved along within packet. Then call av_free_packet(). - Use null AudioSink if audio-id is NONE --- make/resources/android/AndroidManifest-jogl.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'make/resources/android/AndroidManifest-jogl.xml') diff --git a/make/resources/android/AndroidManifest-jogl.xml b/make/resources/android/AndroidManifest-jogl.xml index 1c08cc484..c07ee041b 100644 --- a/make/resources/android/AndroidManifest-jogl.xml +++ b/make/resources/android/AndroidManifest-jogl.xml @@ -4,7 +4,8 @@ package="javax.media.opengl"> - + + -- cgit v1.2.3 From 13f8263f2a6576abc373fb25f044d553f555159d Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 11 Oct 2013 04:20:36 +0200 Subject: Android uses-sdk: Add android:targetSdkVersion="14" (to show up for tablets) --- make/resources/android/AndroidManifest-jogl.xml | 2 +- make/resources/android/AndroidManifest-test.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'make/resources/android/AndroidManifest-jogl.xml') diff --git a/make/resources/android/AndroidManifest-jogl.xml b/make/resources/android/AndroidManifest-jogl.xml index c07ee041b..d88b48fe0 100644 --- a/make/resources/android/AndroidManifest-jogl.xml +++ b/make/resources/android/AndroidManifest-jogl.xml @@ -9,7 +9,7 @@ - + - + Date: Thu, 7 Nov 2013 06:22:52 +0100 Subject: Android: Add NewtDebugActivity --- make/resources/android/AndroidManifest-jogl.xml | 16 +++- make/resources/android/res-jogl/values/strings.xml | 6 +- .../newt/driver/android/NewtDebugActivity.java | 31 +++++++ .../driver/android/NewtDebugActivityLauncher.java | 21 +++++ .../newt/driver/android/NewtVersionActivity.java | 101 ++++++++++++--------- .../android/NewtVersionActivityLauncher.java | 8 +- 6 files changed, 130 insertions(+), 53 deletions(-) create mode 100644 src/newt/classes/jogamp/newt/driver/android/NewtDebugActivity.java create mode 100644 src/newt/classes/jogamp/newt/driver/android/NewtDebugActivityLauncher.java (limited to 'make/resources/android/AndroidManifest-jogl.xml') diff --git a/make/resources/android/AndroidManifest-jogl.xml b/make/resources/android/AndroidManifest-jogl.xml index d88b48fe0..d9a9ac819 100644 --- a/make/resources/android/AndroidManifest-jogl.xml +++ b/make/resources/android/AndroidManifest-jogl.xml @@ -20,8 +20,20 @@ android:finishOnTaskLaunch="true" android:launchMode="singleTop" android:configChanges="keyboardHidden|orientation" - android:label="@string/activity_v_name" - android:description="@string/activity_v_descr" + android:label="@string/activity_version_name" + android:description="@string/activity_version_descr" + > + + + + + + diff --git a/make/resources/android/res-jogl/values/strings.xml b/make/resources/android/res-jogl/values/strings.xml index 3064dad88..ae4816665 100644 --- a/make/resources/android/res-jogl/values/strings.xml +++ b/make/resources/android/res-jogl/values/strings.xml @@ -3,6 +3,8 @@ Jogl Library JogAmp\'s Jogl Library Contains Dalvik and native code, supporting native bindings. - Jogl\'s Version - Shows the version of the JOGL Library and runtime GL infos. + Jogl\'s Version + Shows the version of the JOGL Library and runtime GL infos. + Jogl Debug + Debug output of JOGL\'s initialization. diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtDebugActivity.java b/src/newt/classes/jogamp/newt/driver/android/NewtDebugActivity.java new file mode 100644 index 000000000..a3d9d90a1 --- /dev/null +++ b/src/newt/classes/jogamp/newt/driver/android/NewtDebugActivity.java @@ -0,0 +1,31 @@ +/** + * Copyright 2013 JogAmp Community. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of JogAmp Community. + */ +package jogamp.newt.driver.android; + +public class NewtDebugActivity extends NewtVersionActivity { +} diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtDebugActivityLauncher.java b/src/newt/classes/jogamp/newt/driver/android/NewtDebugActivityLauncher.java new file mode 100644 index 000000000..9d16fdec5 --- /dev/null +++ b/src/newt/classes/jogamp/newt/driver/android/NewtDebugActivityLauncher.java @@ -0,0 +1,21 @@ +package jogamp.newt.driver.android; + +import android.app.Activity; +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.util.Log; + +public class NewtDebugActivityLauncher extends Activity { + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + final Uri uri = Uri.parse("launch://jogamp.org/jogamp.newt.driver.android.NewtDebugActivity?sys=com.jogamp.common&sys=javax.media.opengl&pkg=com.jogamp.opengl.test&jogamp.debug=all&nativewindow.debug=all&jogl.debug=all&newt.debug=all"); + final Intent intent = new Intent("org.jogamp.launcher.action.LAUNCH_ACTIVITY_NORMAL", uri); + Log.d(getClass().getSimpleName(), "Launching Activity: "+intent); + startActivity (intent); + + finish(); // done + } +} diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java b/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java index 9f6210269..dcf176939 100644 --- a/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java +++ b/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java @@ -3,14 +3,14 @@ * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. @@ -50,12 +50,12 @@ public class NewtVersionActivity extends NewtBaseActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - + setFullscreenFeature(getWindow(), true); final android.view.ViewGroup viewGroup = new android.widget.FrameLayout(getActivity().getApplicationContext()); getWindow().setContentView(viewGroup); - + final TextView tv = new TextView(getActivity()); final ScrollView scroller = new ScrollView(getActivity()); scroller.addView(tv); @@ -63,47 +63,58 @@ public class NewtVersionActivity extends NewtBaseActivity { final String info1 = VersionUtil.getPlatformInfo()+Platform.NEWLINE+GlueGenVersion.getInstance()+Platform.NEWLINE+JoglVersion.getInstance()+Platform.NEWLINE; Log.d(MD.TAG, info1); - tv.setText(info1); - - // create GLWindow (-> incl. underlying NEWT Display, Screen & Window) - GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2)); - GLWindow glWindow = GLWindow.create(caps); - glWindow.setUndecorated(true); - glWindow.setSize(32, 32); - glWindow.setPosition(0, 0); - final android.view.View androidGLView = ((WindowDriver)glWindow.getDelegatedWindow()).getAndroidView(); - viewGroup.addView(androidGLView, new android.widget.FrameLayout.LayoutParams(glWindow.getWidth(), glWindow.getHeight(), Gravity.BOTTOM|Gravity.RIGHT)); - registerNEWTWindow(glWindow); - - glWindow.addGLEventListener(new GLEventListener() { - public void init(GLAutoDrawable drawable) { - GL gl = drawable.getGL(); - final StringBuilder sb = new StringBuilder(); - sb.append(JoglVersion.getGLInfo(gl, null, true)).append(Platform.NEWLINE); - sb.append("Requested: ").append(Platform.NEWLINE); - sb.append(drawable.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities()).append(Platform.NEWLINE).append(Platform.NEWLINE); - sb.append("Chosen: ").append(Platform.NEWLINE); - sb.append(drawable.getChosenGLCapabilities()).append(Platform.NEWLINE).append(Platform.NEWLINE); - final String info2 = sb.toString(); - // Log.d(MD.TAG, info2); // too big! - System.err.println(info2); - viewGroup.post(new Runnable() { - public void run() { - tv.append(info2); - viewGroup.removeView(androidGLView); - } } ); - } + tv.setText(info1); + + final GLProfile glp; + if( GLProfile.isAvailable(GLProfile.GL2ES2) ) { + glp = GLProfile.get(GLProfile.GL2ES2); + } else if( GLProfile.isAvailable(GLProfile.GL2ES1) ) { + glp = GLProfile.get(GLProfile.GL2ES1); + } else { + glp = null; + tv.append("No GLProfile GL2ES2 nor GL2ES1 available!"); + } + if( null != glp ) { + // create GLWindow (-> incl. underlying NEWT Display, Screen & Window) + GLCapabilities caps = new GLCapabilities(glp); + GLWindow glWindow = GLWindow.create(caps); + glWindow.setUndecorated(true); + glWindow.setSize(32, 32); + glWindow.setPosition(0, 0); + final android.view.View androidGLView = ((WindowDriver)glWindow.getDelegatedWindow()).getAndroidView(); + viewGroup.addView(androidGLView, new android.widget.FrameLayout.LayoutParams(glWindow.getWidth(), glWindow.getHeight(), Gravity.BOTTOM|Gravity.RIGHT)); + registerNEWTWindow(glWindow); + + glWindow.addGLEventListener(new GLEventListener() { + public void init(GLAutoDrawable drawable) { + GL gl = drawable.getGL(); + final StringBuilder sb = new StringBuilder(); + sb.append(JoglVersion.getGLInfo(gl, null, true)).append(Platform.NEWLINE); + sb.append("Requested: ").append(Platform.NEWLINE); + sb.append(drawable.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities()).append(Platform.NEWLINE).append(Platform.NEWLINE); + sb.append("Chosen: ").append(Platform.NEWLINE); + sb.append(drawable.getChosenGLCapabilities()).append(Platform.NEWLINE).append(Platform.NEWLINE); + final String info2 = sb.toString(); + // Log.d(MD.TAG, info2); // too big! + System.err.println(info2); + viewGroup.post(new Runnable() { + public void run() { + tv.append(info2); + viewGroup.removeView(androidGLView); + } } ); + } - public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { - } + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { + } - public void display(GLAutoDrawable drawable) { - } + public void display(GLAutoDrawable drawable) { + } - public void dispose(GLAutoDrawable drawable) { - } - }); - glWindow.setVisible(true); + public void dispose(GLAutoDrawable drawable) { + } + }); + glWindow.setVisible(true); + } Log.d(MD.TAG, "onCreate - X"); - } + } } diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivityLauncher.java b/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivityLauncher.java index 9b3c6e24b..3374e4184 100644 --- a/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivityLauncher.java +++ b/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivityLauncher.java @@ -10,12 +10,12 @@ public class NewtVersionActivityLauncher extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - + final Uri uri = Uri.parse("launch://jogamp.org/jogamp.newt.driver.android.NewtVersionActivity?sys=com.jogamp.common&sys=javax.media.opengl&pkg=com.jogamp.opengl.test"); - final Intent intent = new Intent("org.jogamp.launcher.action.LAUNCH_ACTIVITY_NORMAL", uri); + final Intent intent = new Intent("org.jogamp.launcher.action.LAUNCH_ACTIVITY_NORMAL", uri); Log.d(getClass().getSimpleName(), "Launching Activity: "+intent); startActivity (intent); - + finish(); // done - } + } } -- cgit v1.2.3 From 87135467c4f292f7e43bc3957784b0e43769c9cc Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 26 Jan 2014 02:59:12 +0100 Subject: Script: Correct joal.jar path; Remove redundant NewtDebugActivity (Debug is on for NewtVersionActivity) --- make/resources/android/AndroidManifest-jogl.xml | 12 --- make/resources/android/res-jogl/values/strings.xml | 2 - make/scripts/make.jogl.all.android-armv6-cross.sh | 2 + make/scripts/setenv-jogl.sh | 2 +- .../newt/driver/android/NewtDebugActivity.java | 38 ------- .../driver/android/NewtDebugActivityLauncher.java | 21 ---- .../newt/driver/android/NewtVersionActivity.java | 88 ++++++++++++++- .../android/NewtVersionActivityLauncher.java | 2 +- .../driver/android/NewtVersionBaseActivity.java | 120 --------------------- 9 files changed, 90 insertions(+), 197 deletions(-) delete mode 100644 src/newt/classes/jogamp/newt/driver/android/NewtDebugActivity.java delete mode 100644 src/newt/classes/jogamp/newt/driver/android/NewtDebugActivityLauncher.java delete mode 100644 src/newt/classes/jogamp/newt/driver/android/NewtVersionBaseActivity.java (limited to 'make/resources/android/AndroidManifest-jogl.xml') diff --git a/make/resources/android/AndroidManifest-jogl.xml b/make/resources/android/AndroidManifest-jogl.xml index d9a9ac819..1b6c46356 100644 --- a/make/resources/android/AndroidManifest-jogl.xml +++ b/make/resources/android/AndroidManifest-jogl.xml @@ -28,18 +28,6 @@ - - - - - - diff --git a/make/resources/android/res-jogl/values/strings.xml b/make/resources/android/res-jogl/values/strings.xml index ae4816665..e88a0a4e0 100644 --- a/make/resources/android/res-jogl/values/strings.xml +++ b/make/resources/android/res-jogl/values/strings.xml @@ -5,6 +5,4 @@ Contains Dalvik and native code, supporting native bindings. Jogl\'s Version Shows the version of the JOGL Library and runtime GL infos. - Jogl Debug - Debug output of JOGL\'s initialization. diff --git a/make/scripts/make.jogl.all.android-armv6-cross.sh b/make/scripts/make.jogl.all.android-armv6-cross.sh index 2b8f9a30e..1b5f5bf44 100755 --- a/make/scripts/make.jogl.all.android-armv6-cross.sh +++ b/make/scripts/make.jogl.all.android-armv6-cross.sh @@ -1,5 +1,7 @@ #! /bin/sh +SDIR=`dirname $0` + if [ -e $SDIR/../../../gluegen/make/scripts/setenv-build-jogl-x86_64.sh ] ; then . $SDIR/../../../gluegen/make/scripts/setenv-build-jogl-x86_64.sh fi diff --git a/make/scripts/setenv-jogl.sh b/make/scripts/setenv-jogl.sh index 186da5505..dc121a596 100755 --- a/make/scripts/setenv-jogl.sh +++ b/make/scripts/setenv-jogl.sh @@ -73,7 +73,7 @@ if [ ! -e "$JOAL_BUILDDIR" ] ; then print_usage exit fi -JOAL_JAR="$JOAL_BUILDDIR"/joal.jar +JOAL_JAR="$JOAL_BUILDDIR"/jar/joal.jar if [ -z "$ANT_PATH" ] ; then ANT_PATH=$(dirname $(dirname $(which ant))) diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtDebugActivity.java b/src/newt/classes/jogamp/newt/driver/android/NewtDebugActivity.java deleted file mode 100644 index 40a6ec6dc..000000000 --- a/src/newt/classes/jogamp/newt/driver/android/NewtDebugActivity.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright 2013 JogAmp Community. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of JogAmp Community. - */ -package jogamp.newt.driver.android; - -import android.os.Bundle; - -public class NewtDebugActivity extends NewtVersionBaseActivity { - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate("NewtDebugActivity - DEBUG MODE", savedInstanceState); - } -} diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtDebugActivityLauncher.java b/src/newt/classes/jogamp/newt/driver/android/NewtDebugActivityLauncher.java deleted file mode 100644 index 9d16fdec5..000000000 --- a/src/newt/classes/jogamp/newt/driver/android/NewtDebugActivityLauncher.java +++ /dev/null @@ -1,21 +0,0 @@ -package jogamp.newt.driver.android; - -import android.app.Activity; -import android.content.Intent; -import android.net.Uri; -import android.os.Bundle; -import android.util.Log; - -public class NewtDebugActivityLauncher extends Activity { - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - final Uri uri = Uri.parse("launch://jogamp.org/jogamp.newt.driver.android.NewtDebugActivity?sys=com.jogamp.common&sys=javax.media.opengl&pkg=com.jogamp.opengl.test&jogamp.debug=all&nativewindow.debug=all&jogl.debug=all&newt.debug=all"); - final Intent intent = new Intent("org.jogamp.launcher.action.LAUNCH_ACTIVITY_NORMAL", uri); - Log.d(getClass().getSimpleName(), "Launching Activity: "+intent); - startActivity (intent); - - finish(); // done - } -} diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java b/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java index 8a7f3af87..259acb8f3 100644 --- a/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java +++ b/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java @@ -27,11 +27,95 @@ */ package jogamp.newt.driver.android; +import javax.media.opengl.GL; +import javax.media.opengl.GLAutoDrawable; +import javax.media.opengl.GLCapabilities; +import javax.media.opengl.GLEventListener; +import javax.media.opengl.GLProfile; + +import com.jogamp.common.GlueGenVersion; +import com.jogamp.common.os.Platform; +import com.jogamp.common.util.VersionUtil; +import com.jogamp.newt.opengl.GLWindow; +import com.jogamp.opengl.JoglVersion; + import android.os.Bundle; +import android.util.Log; +import android.view.Gravity; +import android.view.ViewGroup.LayoutParams; +import android.widget.ScrollView; +import android.widget.TextView; + +public class NewtVersionActivity extends NewtBaseActivity { -public class NewtVersionActivity extends NewtVersionBaseActivity { @Override public void onCreate(Bundle savedInstanceState) { - super.onCreate("NewtVersionActivity - NORMAL MODE", savedInstanceState); + super.onCreate(savedInstanceState); + + setFullscreenFeature(getWindow(), true); + + final android.view.ViewGroup viewGroup = new android.widget.FrameLayout(getActivity().getApplicationContext()); + getWindow().setContentView(viewGroup); + + final TextView tv = new TextView(getActivity()); + final ScrollView scroller = new ScrollView(getActivity()); + scroller.addView(tv); + viewGroup.addView(scroller, new android.widget.FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, Gravity.TOP|Gravity.LEFT)); + + final String info1 = "JOGL Version Info"+Platform.NEWLINE+VersionUtil.getPlatformInfo()+Platform.NEWLINE+GlueGenVersion.getInstance()+Platform.NEWLINE+JoglVersion.getInstance()+Platform.NEWLINE; + Log.d(MD.TAG, info1); + tv.setText(info1); + + final GLProfile glp; + if( GLProfile.isAvailable(GLProfile.GL2ES2) ) { + glp = GLProfile.get(GLProfile.GL2ES2); + } else if( GLProfile.isAvailable(GLProfile.GL2ES1) ) { + glp = GLProfile.get(GLProfile.GL2ES1); + } else { + glp = null; + tv.append("No GLProfile GL2ES2 nor GL2ES1 available!"); + } + if( null != glp ) { + // create GLWindow (-> incl. underlying NEWT Display, Screen & Window) + GLCapabilities caps = new GLCapabilities(glp); + GLWindow glWindow = GLWindow.create(caps); + glWindow.setUndecorated(true); + glWindow.setSize(32, 32); + glWindow.setPosition(0, 0); + final android.view.View androidGLView = ((WindowDriver)glWindow.getDelegatedWindow()).getAndroidView(); + viewGroup.addView(androidGLView, new android.widget.FrameLayout.LayoutParams(glWindow.getWidth(), glWindow.getHeight(), Gravity.BOTTOM|Gravity.RIGHT)); + registerNEWTWindow(glWindow); + + glWindow.addGLEventListener(new GLEventListener() { + public void init(GLAutoDrawable drawable) { + GL gl = drawable.getGL(); + final StringBuilder sb = new StringBuilder(); + sb.append(JoglVersion.getGLInfo(gl, null, true)).append(Platform.NEWLINE); + sb.append("Requested: ").append(Platform.NEWLINE); + sb.append(drawable.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities()).append(Platform.NEWLINE).append(Platform.NEWLINE); + sb.append("Chosen: ").append(Platform.NEWLINE); + sb.append(drawable.getChosenGLCapabilities()).append(Platform.NEWLINE).append(Platform.NEWLINE); + final String info2 = sb.toString(); + // Log.d(MD.TAG, info2); // too big! + System.err.println(info2); + viewGroup.post(new Runnable() { + public void run() { + tv.append(info2); + viewGroup.removeView(androidGLView); + } } ); + } + + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { + } + + public void display(GLAutoDrawable drawable) { + } + + public void dispose(GLAutoDrawable drawable) { + } + }); + glWindow.setVisible(true); + } + Log.d(MD.TAG, "onCreate - X"); } } diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivityLauncher.java b/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivityLauncher.java index 3374e4184..553900f6a 100644 --- a/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivityLauncher.java +++ b/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivityLauncher.java @@ -11,7 +11,7 @@ public class NewtVersionActivityLauncher extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - final Uri uri = Uri.parse("launch://jogamp.org/jogamp.newt.driver.android.NewtVersionActivity?sys=com.jogamp.common&sys=javax.media.opengl&pkg=com.jogamp.opengl.test"); + final Uri uri = Uri.parse("launch://jogamp.org/jogamp.newt.driver.android.NewtVersionActivity?sys=com.jogamp.common&sys=javax.media.opengl&pkg=com.jogamp.opengl.test&jogamp.debug=all&nativewindow.debug=all&jogl.debug=all&newt.debug=all"); final Intent intent = new Intent("org.jogamp.launcher.action.LAUNCH_ACTIVITY_NORMAL", uri); Log.d(getClass().getSimpleName(), "Launching Activity: "+intent); startActivity (intent); diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtVersionBaseActivity.java b/src/newt/classes/jogamp/newt/driver/android/NewtVersionBaseActivity.java deleted file mode 100644 index f24fb20ac..000000000 --- a/src/newt/classes/jogamp/newt/driver/android/NewtVersionBaseActivity.java +++ /dev/null @@ -1,120 +0,0 @@ -/** - * Copyright 2011 JogAmp Community. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of JogAmp Community. - */ -package jogamp.newt.driver.android; - -import javax.media.opengl.GL; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLEventListener; -import javax.media.opengl.GLProfile; - -import com.jogamp.common.GlueGenVersion; -import com.jogamp.common.os.Platform; -import com.jogamp.common.util.VersionUtil; -import com.jogamp.newt.opengl.GLWindow; -import com.jogamp.opengl.JoglVersion; - -import android.os.Bundle; -import android.util.Log; -import android.view.Gravity; -import android.view.ViewGroup.LayoutParams; -import android.widget.ScrollView; -import android.widget.TextView; - -public class NewtVersionBaseActivity extends NewtBaseActivity { - - public void onCreate(String prefix, Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - setFullscreenFeature(getWindow(), true); - - final android.view.ViewGroup viewGroup = new android.widget.FrameLayout(getActivity().getApplicationContext()); - getWindow().setContentView(viewGroup); - - final TextView tv = new TextView(getActivity()); - final ScrollView scroller = new ScrollView(getActivity()); - scroller.addView(tv); - viewGroup.addView(scroller, new android.widget.FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, Gravity.TOP|Gravity.LEFT)); - - final String info1 = prefix+Platform.NEWLINE+VersionUtil.getPlatformInfo()+Platform.NEWLINE+GlueGenVersion.getInstance()+Platform.NEWLINE+JoglVersion.getInstance()+Platform.NEWLINE; - Log.d(MD.TAG, info1); - tv.setText(info1); - - final GLProfile glp; - if( GLProfile.isAvailable(GLProfile.GL2ES2) ) { - glp = GLProfile.get(GLProfile.GL2ES2); - } else if( GLProfile.isAvailable(GLProfile.GL2ES1) ) { - glp = GLProfile.get(GLProfile.GL2ES1); - } else { - glp = null; - tv.append("No GLProfile GL2ES2 nor GL2ES1 available!"); - } - if( null != glp ) { - // create GLWindow (-> incl. underlying NEWT Display, Screen & Window) - GLCapabilities caps = new GLCapabilities(glp); - GLWindow glWindow = GLWindow.create(caps); - glWindow.setUndecorated(true); - glWindow.setSize(32, 32); - glWindow.setPosition(0, 0); - final android.view.View androidGLView = ((WindowDriver)glWindow.getDelegatedWindow()).getAndroidView(); - viewGroup.addView(androidGLView, new android.widget.FrameLayout.LayoutParams(glWindow.getWidth(), glWindow.getHeight(), Gravity.BOTTOM|Gravity.RIGHT)); - registerNEWTWindow(glWindow); - - glWindow.addGLEventListener(new GLEventListener() { - public void init(GLAutoDrawable drawable) { - GL gl = drawable.getGL(); - final StringBuilder sb = new StringBuilder(); - sb.append(JoglVersion.getGLInfo(gl, null, true)).append(Platform.NEWLINE); - sb.append("Requested: ").append(Platform.NEWLINE); - sb.append(drawable.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities()).append(Platform.NEWLINE).append(Platform.NEWLINE); - sb.append("Chosen: ").append(Platform.NEWLINE); - sb.append(drawable.getChosenGLCapabilities()).append(Platform.NEWLINE).append(Platform.NEWLINE); - final String info2 = sb.toString(); - // Log.d(MD.TAG, info2); // too big! - System.err.println(info2); - viewGroup.post(new Runnable() { - public void run() { - tv.append(info2); - viewGroup.removeView(androidGLView); - } } ); - } - - public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { - } - - public void display(GLAutoDrawable drawable) { - } - - public void dispose(GLAutoDrawable drawable) { - } - }); - glWindow.setVisible(true); - } - Log.d(MD.TAG, "onCreate - X"); - } -} -- cgit v1.2.3