AWTPanelsContext Doesn't Extract Natives

I’ve been using the AWTPanel as my display component. In order to use it, you have to set a custom renderer.

[java]settings.setCustomRenderer(AwtPanelsContext.class);[/java]

Unfortunately, setting this as the renderer doesn’t trigger the extracting of the native libs. The jm3 Natives code looks like:

[java] public static void extractNativeLibs(Platform platform, AppSettings settings) throws IOException {
String renderer = settings.getRenderer();
String audioRenderer = settings.getAudioRenderer();
boolean needLWJGL = false;
boolean needOAL = false;
boolean needJInput = false;
boolean needNativeBullet = isUsingNativeBullet();

    if (renderer != null) {
        if (renderer.startsWith("LWJGL")) {
            needLWJGL = true;
        }
    }


[/java]

When using AwtPanelsContext.class as the renderer, the renderer string is CUSTOMcom.jme3.system.awt.AwtPanelsContext, so needLWJGL stays false, and the lwjgl natives are not unpacked. I can work around this, but I thought the devs might want to know.

thanks,

Nick

You look for something like this maybee?

		ConfigFrame.app = new CompileApplication();
		ConfigFrame.app.setShowSettings(false);
		ConfigFrame.app.start(JmeContext.Type.Canvas);
		// dirty dirty!
		while (!ConfigFrame.app.started) {
			try {
				Thread.sleep(100);
			} catch (final InterruptedException e) {
				e.printStackTrace();
			}
		}
		this.jcan = (JmeCanvasContext) ConfigFrame.app.getContext();
		final Canvas canvas = this.jcan.getCanvas();
		final Dimension dim = new Dimension(768, 768); //eg my resolutin used in the embedded screen?
		canvas.setSize(dim);
		canvas.setPreferredSize(dim);
		canvas.setMaximumSize(dim);
		canvas.setMinimumSize(dim);
		this.add(canvas, constraints);

The canvas is a java.awt.Canvas so it should work or?

Or is there another reason why you need the panel and cannot use the native lwjgl one?

Thanks. I’ve tried using that and had some issues. See this thread http://hub.jmonkeyengine.org/forum/topic/multiple-tabbed-displays/.

Ah I see, thats why you use that panel. Yes, seems like a bug then that they are not extracted, thought they were both doing the same :slight_smile: