How to render jme contents into a custom GLSurfaceView in Android

Hello, how can I render jme Rendering contents into a custom GLSurfaceView in Android. I don’t want to use AndroidHarness because it renders full-screen but i don’t want to render in full screen i want to render it into a specific dp (like 300dp height and width) GLSurfaceView.
I hope you guys understand what I mean to say.
Thanks in advance for helping me.

1 Like

Hello,

Maybe JmeSurfaceView is what you are looking for:

2 Likes

Ok i seen that, so how i render things into that view like Simple application has root node we can attach something into it and it renders.

1 Like

I have not used it before, but maybe @Pavl_G can help you.

1 Like

How do i contect him?

1 Like

He will respond to you here after reading your post. Also, you may want to take a look at this example:

1 Like

Yes I got what I want to do. Thanks

3 Likes

Hello there,

@Ubuntu_Twenty JmeSurfaceView utilizes an android GlSurfaceView internally outside of an activity context, so you can embed jme renderer as an android native UI component, if that is your target then, there are a lot of examples in addition to the one linked by @Ali_RS.

But, JmeSurfaceView uses a SimpleApplication, so you have to learn jme to create your game.

One thing to note, that JmeSurfaceView has a package migration on jme-3.6.0 from com.jme3.app.jmeSurfaceVIew.JmeSurfaceView to com.jme3.view.surfaceview.JmeSurfaceView (the examples linked above are updated with the snapshot version from my local disk, you need to change 3.4.0-SNAPSHOT to 3.6.0-beta1).

4 Likes

Ok, thanks @Pavl_G and @Ali_RS
I got it. :relaxed:

2 Likes