Search in sources :

Example 1 with JoglSpace

use of spacegraph.video.JoglSpace in project narchy by automenta.

the class WindowToggleButton method value.

@Override
public void value(ToggleButton t, boolean enabled) {
    if (enabled) {
        JoglSpace space;
        synchronized (spacer) {
            space = this.space;
            if (space == null) {
                space = this.space = SpaceGraph.window(spacer.get(), width, height);
                space.addWindowListener(this);
            }
        }
        int sx = Finger.pointer.getX();
        int sy = Finger.pointer.getY();
        int nx = sx - width / 2;
        int ny = sy - height / 2;
        space.window.setPosition(nx, ny);
    // space.show(this.toString(), width,height, nx, ny);
    // space.window.setTitle(label.value());
    } else {
        synchronized (spacer) {
            if (space != null) {
                GLWindow win = this.space.window;
                this.space = null;
                if (win.getWindowHandle() != 0)
                    win.destroy();
            }
        }
    }
}
Also used : JoglSpace(spacegraph.video.JoglSpace) GLWindow(com.jogamp.newt.opengl.GLWindow)

Aggregations

GLWindow (com.jogamp.newt.opengl.GLWindow)1 JoglSpace (spacegraph.video.JoglSpace)1