From 1b1a05eb49cc3a0e0da505c175388ae1147ea2d6 Mon Sep 17 00:00:00 2001
From: Sven Gothel
- * Example of an applet tag using GearsES2 within the applet area (normal case):
- *
- <applet width=100 height=100>
- <param name="java_arguments" value="-Dsun.java2d.noddraw=true">
- <param name="gl_event_listener_class" value="com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2">
- <param name="gl_profile" value="GL2">
- <param name="gl_swap_interval" value="1">
- <param name="gl_debug" value="false">
- <param name="gl_trace" value="false">
- <param name="jnlp_href" value="jogl-newt-applet-runner.jnlp">
- </applet>Hello Gears !
- *
- *
- * Example of an applet tag using GearsES2 in an undecorated, translucent, closeable and always-on-top window: - *
- <applet width=1 height=1> - <param name="java_arguments" value="-Dsun.java2d.noddraw=true"> - <param name="gl_event_listener_class" value="com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2"> - <param name="gl_profile" value="GL2"> - <param name="gl_swap_interval" value="1"> - <param name="gl_undecorated" value="true"> - <param name="gl_alwaysontop" value="true"> - <param name="gl_closeable" value="true"> - <param name="gl_alpha" value="1"> - <param name="gl_multisamplebuffer" value="0"> - <param name="gl_opaque" value="false"> - <param name="gl_dx" value="10"> - <param name="gl_dy" value="0"> - <param name="gl_width" value="100"> - <param name="gl_height" value="100"> - <param name="gl_nodefaultkeyListener" value="true"> - <param name="gl_debug" value="false"> - <param name="gl_trace" value="false"> - <param name="jnlp_href" value="jogl-newt-applet-runner.jnlp"> - </applet>Hello Gears ! - *- * - */ -public class JOGLNewtApplet3Run implements Applet3 { - public static final boolean DEBUG = JOGLNewtAppletBase.DEBUG; - - GLWindow glWindow = null; - JOGLNewtAppletBase base = null; - /** if valid glStandalone:=true (own window) ! */ - int glXd=Integer.MAX_VALUE, glYd=Integer.MAX_VALUE, glWidth=Integer.MAX_VALUE, glHeight=Integer.MAX_VALUE; - Applet3Context ctx; - boolean glStandalone = false; - UpstreamWindowHookMutableSizePos upstreamSizePosHook; - PointImmutable upstreamLocOnScreen; - NativeWindow browserWin; - - final String getParameter(final String name) { - return ctx.getParameter(name); - } - - @Override - public NativeWindowDownstream createNativeWindow(final Applet3Context ctx, final NativeWindowUpstream upstreamWin) { - this.ctx = ctx; - - String glProfileName=null; - boolean glOpaque=true; - int glAlphaBits=0; - int glNumMultisampleBuffer=0; - boolean glUndecorated=false; - boolean glAlwaysOnTop=false; - try { - glProfileName = getParameter("gl_profile"); - glOpaque = JOGLNewtAppletBase.str2Bool(getParameter("gl_opaque"), glOpaque); - glAlphaBits = JOGLNewtAppletBase.str2Int(getParameter("gl_alpha"), glAlphaBits); - glNumMultisampleBuffer = JOGLNewtAppletBase.str2Int(getParameter("gl_multisamplebuffer"), glNumMultisampleBuffer); - glXd = JOGLNewtAppletBase.str2Int(getParameter("gl_dx"), glXd); - glYd = JOGLNewtAppletBase.str2Int(getParameter("gl_dy"), glYd); - glWidth = JOGLNewtAppletBase.str2Int(getParameter("gl_width"), glWidth); - glHeight = JOGLNewtAppletBase.str2Int(getParameter("gl_height"), glHeight); - glUndecorated = JOGLNewtAppletBase.str2Bool(getParameter("gl_undecorated"), glUndecorated); - glAlwaysOnTop = JOGLNewtAppletBase.str2Bool(getParameter("gl_alwaysontop"), glAlwaysOnTop); - } catch (final Exception e) { - e.printStackTrace(); - } - glStandalone = Integer.MAX_VALUE>glXd && Integer.MAX_VALUE>glYd && Integer.MAX_VALUE>glWidth && Integer.MAX_VALUE>glHeight; - final GLCapabilities caps = new GLCapabilities(GLProfile.get(glProfileName)); - caps.setAlphaBits(glAlphaBits); - if(0
+ <applet width=100 height=100> + <param name="java_arguments" value="-Dsun.java2d.noddraw=true"> + <param name="gl_event_listener_class" value="com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2"> + <param name="gl_profile" value="GL2"> + <param name="gl_swap_interval" value="1"> + <param name="gl_debug" value="false"> + <param name="gl_trace" value="false"> + <param name="jnlp_href" value="jogl-newt-applet-runner.jnlp"> + </applet>Hello Gears ! + *+ * + * + *
+ * Example of an applet tag using GearsES2 in an undecorated, translucent, closeable and always-on-top window: + *
+ <applet width=1 height=1> + <param name="java_arguments" value="-Dsun.java2d.noddraw=true"> + <param name="gl_event_listener_class" value="com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2"> + <param name="gl_profile" value="GL2"> + <param name="gl_swap_interval" value="1"> + <param name="gl_undecorated" value="true"> + <param name="gl_alwaysontop" value="true"> + <param name="gl_closeable" value="true"> + <param name="gl_alpha" value="1"> + <param name="gl_multisamplebuffer" value="0"> + <param name="gl_opaque" value="false"> + <param name="gl_dx" value="10"> + <param name="gl_dy" value="0"> + <param name="gl_width" value="100"> + <param name="gl_height" value="100"> + <param name="gl_nodefaultkeyListener" value="true"> + <param name="gl_debug" value="false"> + <param name="gl_trace" value="false"> + <param name="jnlp_href" value="jogl-newt-applet-runner.jnlp"> + </applet>Hello Gears ! + *+ * + */ +public class JOGLNewtApplet3Run implements Applet3 { + public static final boolean DEBUG = JOGLNewtAppletBase.DEBUG; + + GLWindow glWindow = null; + JOGLNewtAppletBase base = null; + /** if valid glStandalone:=true (own window) ! */ + int glXd=Integer.MAX_VALUE, glYd=Integer.MAX_VALUE, glWidth=Integer.MAX_VALUE, glHeight=Integer.MAX_VALUE; + Applet3Context ctx; + boolean glStandalone = false; + UpstreamWindowHookMutableSizePos upstreamSizePosHook; + PointImmutable upstreamLocOnScreen; + NativeWindow browserWin; + + final String getParameter(final String name) { + return ctx.getParameter(name); + } + + @Override + public NativeWindowDownstream createNativeWindow(final Applet3Context ctx, final NativeWindowUpstream upstreamWin) { + this.ctx = ctx; + + String glProfileName=null; + boolean glOpaque=true; + int glAlphaBits=0; + int glNumMultisampleBuffer=0; + boolean glUndecorated=false; + boolean glAlwaysOnTop=false; + try { + glProfileName = getParameter("gl_profile"); + glOpaque = JOGLNewtAppletBase.str2Bool(getParameter("gl_opaque"), glOpaque); + glAlphaBits = JOGLNewtAppletBase.str2Int(getParameter("gl_alpha"), glAlphaBits); + glNumMultisampleBuffer = JOGLNewtAppletBase.str2Int(getParameter("gl_multisamplebuffer"), glNumMultisampleBuffer); + glXd = JOGLNewtAppletBase.str2Int(getParameter("gl_dx"), glXd); + glYd = JOGLNewtAppletBase.str2Int(getParameter("gl_dy"), glYd); + glWidth = JOGLNewtAppletBase.str2Int(getParameter("gl_width"), glWidth); + glHeight = JOGLNewtAppletBase.str2Int(getParameter("gl_height"), glHeight); + glUndecorated = JOGLNewtAppletBase.str2Bool(getParameter("gl_undecorated"), glUndecorated); + glAlwaysOnTop = JOGLNewtAppletBase.str2Bool(getParameter("gl_alwaysontop"), glAlwaysOnTop); + } catch (final Exception e) { + e.printStackTrace(); + } + glStandalone = Integer.MAX_VALUE>glXd && Integer.MAX_VALUE>glYd && Integer.MAX_VALUE>glWidth && Integer.MAX_VALUE>glHeight; + final GLCapabilities caps = new GLCapabilities(GLProfile.get(glProfileName)); + caps.setAlphaBits(glAlphaBits); + if(0