1package com.jogamp.newt.util.applet3;
3import com.jogamp.plugin.applet.Applet3;
4import com.jogamp.plugin.applet.Applet3Context;
5import com.jogamp.plugin.ui.NativeWindowDownstream;
6import com.jogamp.plugin.ui.NativeWindowUpstream;
9import java.util.Locale;
11import com.jogamp.opengl.GLProfile;
12import com.jogamp.opengl.GL;
13import com.jogamp.opengl.GLAutoDrawable;
14import com.jogamp.opengl.GLCapabilities;
15import com.jogamp.opengl.GLCapabilitiesImmutable;
16import com.jogamp.opengl.GLDrawableFactory;
17import com.jogamp.opengl.GLEventListener;
19import com.jogamp.common.GlueGenVersion;
20import com.jogamp.common.util.VersionUtil;
21import com.jogamp.newt.NewtFactory;
22import com.jogamp.newt.Window;
23import com.jogamp.newt.opengl.GLWindow;
24import com.jogamp.opengl.JoglVersion;
28 public static void main(
final String[] args) {
31 final NativeWindowDownstream nwc = va.
createNativeWindow(
null,
new NativeWindowUpstream() {
33 public long getWindowHandle() {
37 public int getWidth() {
41 public int getHeight() {
45 public String getDisplayConnection() {
49 public int getScreenIndex() {
53 public void notifySurfaceUpdated(
final NativeWindowDownstream swappedWin) {
75 public NativeWindowDownstream
createNativeWindow(
final Applet3Context ctx,
final NativeWindowUpstream parentWin) {
79 canvas.
setSize(parentWin.getWidth(), parentWin.getHeight());
81 return new NativeWindowDownstream() {
83 public void setVisible(
final boolean v) {
84 if(
null != canvas ) {
90 public void setSize(
final int width,
final int height) {
91 if(
null != canvas ) {
97 public void requestFocus() {
98 if(
null != canvas ) {
105 if(
null != canvas ) {
111 public NativeWindowUpstream getParent() {
116 public long getWindowHandle() {
117 if(
null != canvas ) {
125 public void display() {
126 if(
null != canvas ) {
132 public void notifyPositionChanged(
final NativeWindowUpstream nw) {
133 if(
null != canvas ) {
141 public void init(
final Applet3Context ctx) {
142 System.err.println(
"VersionApplet: init() - begin");
144 System.err.println(
"VersionApplet: init() - end");
149 System.err.println(
"VersionApplet: start() - begin");
153 s = VersionUtil.getPlatformInfo().toString();
154 System.err.println(s);
156 s = GlueGenVersion.getInstance().toString();
157 System.err.println(s);
165 System.err.println(s);
169 for(
int i=0; i<availCaps.size(); i++) {
170 s = availCaps.get(i).toString();
171 System.err.println(s);
174 System.err.println(
"VersionApplet: start() - end");
179 System.err.println(
"VersionApplet: stop() - begin");
181 System.err.println(
"VersionApplet: stop() - end");
186 System.err.println(
"VersionApplet: destroy() - start");
191 System.err.println(
"VersionApplet: destroy() - end");
212 final GL gl = drawable.
getGL();
214 System.err.println(s);
217 public void reshape(
final GLAutoDrawable drawable,
final int x,
final int y,
final int width,
final int height) {
220 public void display(
final GLAutoDrawable drawable) {
223 public void dispose(
final GLAutoDrawable drawable) {
static Window createWindow(final CapabilitiesImmutable caps)
Create a top level Window entity on the default Display and default Screen.
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
final void setPosition(final int x, final int y)
Sets the location of the window's client area excluding insets (window decorations) in window units.
final void setSize(final int width, final int height)
Sets the size of the window's client area in window units, excluding decorations.
final void setVisible(final boolean visible)
Calls setVisible(true, visible), i.e.
final long getWindowHandle()
Returns the window handle for this NativeWindow.
final void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext.
final void requestFocus()
Request focus for this native window.
static GLWindow create(final GLCapabilitiesImmutable caps)
Creates a new GLWindow attaching a new Window referencing a new default Screen and default Display wi...
static void main(final String[] args)
void init(final Applet3Context ctx)
NativeWindowDownstream createNativeWindow(final Applet3Context ctx, final NativeWindowUpstream parentWin)
String[][] getParameterInfo()
Specifies a set of OpenGL capabilities.
final List< GLCapabilitiesImmutable > getAvailableCapabilities(AbstractGraphicsDevice device)
Returns an array of available GLCapabilities for the device.
static GLDrawableFactory getFactory(final GLProfile glProfile)
Returns the sole GLDrawableFactory instance.
Specifies the the OpenGL profile.
static GLProfile getDefault(final AbstractGraphicsDevice device)
Returns a default GLProfile object, reflecting the best for the running platform.
static JoglVersion getInstance()
static StringBuilder getGLInfo(final GL gl, final StringBuilder sb)
StringBuilder toString(final GL gl, StringBuilder sb)
Specifying NEWT's Window functionality:
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
GL getGL()
Returns the GL pipeline object this GLAutoDrawable uses.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
GLProfile getGLProfile()
Fetches the GLProfile for this drawable.
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.