Answer the question
In order to leave comments, you need to log in
Sample app not working?
I found a code example here https://github.com/sgothel/jogl-demos/blob/master/... Threw it
into my project
package com.example.myapplication;
import androidx.appcompat.app.AppCompatActivity;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLProfile;
import jogamp.newt.driver.android.NewtBaseActivity;
import android.os.Bundle;
//import com.jogamp.newt.ScreenMode;
import com.jogamp.newt.event.MouseAdapter;
import com.jogamp.newt.event.MouseEvent;
//import com.jogamp.newt.event.ScreenModeListener;
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.opengl.util.Animator;
public class MainActivity extends NewtBaseActivity
{
static {
System.loadLibrary("gluegen-rt");
}
@Override public void onCreate(
final Bundle state)
{
super.onCreate(state);
final GLCapabilities caps =
new GLCapabilities(GLProfile.get(GLProfile.GLES2));
final GLWindow gl_window = GLWindow.create(caps);
gl_window.setFullscreen(true);
this.setContentView(this.getWindow(), gl_window);
gl_window.addMouseListener(new MouseAdapter() {
@Override public void mousePressed(
final MouseEvent e)
{
/*
if (e.getPressure() > 2f) { // show Keyboard
((com.jogamp.newt.Window) e.getSource()).setKeyboardVisible(true);
}
*/
}
});
/*
final Example example = new Example();
// demo.enableAndroidTrace(true);
gl_window.addGLEventListener(example);
gl_window.getScreen().addScreenModeListener(new ScreenModeListener() {
@SuppressWarnings("unused") public void screenModeChangeNotify(
final ScreenMode sm)
{
// Nothing.
}
@SuppressWarnings("unused") public void screenModeChanged(
final ScreenMode sm,
final boolean success)
{
System.err.println("ScreenMode Changed: " + sm);
}
});
*/
final Animator animator = new Animator(gl_window);
this.setAnimator(animator);
gl_window.setVisible(true);
animator.setUpdateFPSFrames(60, System.err);
animator.resetFPSCounter();
gl_window.resetFPSCounter();
}
}
2020-10-02 17:51:39.760 14351-14351/com.example.myapplication E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.myapplication, PID: 14351
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapplication/com.example.myapplication.MainActivity}: com.jogamp.opengl.GLException: No default device available
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3304)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3443)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2040)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:221)
at android.app.ActivityThread.main(ActivityThread.java:7520)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Caused by: com.jogamp.opengl.GLException: No default device available
at com.jogamp.opengl.GLProfile.getProfileMap(GLProfile.java:2300)
at com.jogamp.opengl.GLProfile.get(GLProfile.java:988)
at com.jogamp.opengl.GLProfile.get(GLProfile.java:1004)
at com.example.myapplication.MainActivity.onCreate(MainActivity.java:26)
at android.app.Activity.performCreate(Activity.java:7893)
at android.app.Activity.performCreate(Activity.java:7880)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3279)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3443)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2040)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:221)
at android.app.ActivityThread.main(ActivityThread.java:7520)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Answer the question
In order to leave comments, you need to log in
Come to terms with the idea that looking for code on the Internet is not a programmer.
JogAmp is the home of high performance Java™ libraries for 3D Graphics, Multimedia and Processing.
JOGL, JOCL and JOAL provide cross platform Java™ language bindings to the OpenGL®, OpenCL™, OpenAL and OpenMAX APIs.
tricky question .
Which of these do you think the android emulator supports?
Liba for using hardware buns.
in the error message main
Caused by: com.jogamp.opengl.GLException: No default device available
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question