Package org.pollux3d.app

Source Code of org.pollux3d.app.TuioApplication

package org.pollux3d.app;

import org.pollux3d.tuio.TuioDeviceNetwork;
import org.pollux3d.tuio.TuioInput;
import org.pollux3d.tuio.win7.TuioDeviceWin7;

import com.jme3.app.SimpleApplication;

public abstract class TuioApplication extends SimpleApplication {
 
  protected String windowName = "TuioGame";
 
  protected TuioInput tuioInput;
 
  public void simpleInitApp() {
   
    // disable all inputs
    //this.settings.setUseInput(false);
    //this.setSettings(this.settings);
   
    this.tuioInput = TuioInput.get();
    this.tuioInput.setScreen(this.getCamera().getWidth(), this.getCamera().getHeight());
    this.context.setTitle(windowName);
    this.tuioInput.setWindowName(windowName);
    if (System.getProperty("os.name").equals("Windows 7")) {
      this.tuioInput.setTuioDevice(new TuioDeviceWin7());
    //} else if (System.getProperty("os.name").equals("Mac OS X")) {
    } else {
      this.tuioInput.setTuioDevice(new TuioDeviceNetwork());
    }
  }
 
  public void loadStatsView() {
   
  }
 
  protected void destroyInput(){
    super.destroyInput();
    if (this.tuioInput != null)
      this.tuioInput.destroy();
  }
 
   public void simpleUpdate(float tpf) {
    this.tuioInput.update();
  }
}
TOP

Related Classes of org.pollux3d.app.TuioApplication

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.