Java 类com.badlogic.gdx.backends.lwjgl.LwjglCanvas 实例源码

项目:gdx-texture-packer-gui    文件:AwtFrameLauncher.java   
public static void start(final Arguments arguments) {
    EventQueue.invokeLater(new Runnable() {
        @Override
        public void run() {
            LoggerUtils.setupExternalFileOutput();

            final LwjglCanvasConfiguration config = new LwjglCanvasConfiguration();
            config.title = AppConstants.APP_TITLE;
            config.preferencesDirectory = AppConstants.EXTERNAL_DIR;
            config.iconFilePath = "icon128.png";
            config.width = 1024;
            config.height = 600;
            config.allowSoftwareMode = arguments.softOpenGL;
            config.useHDPI = true;

            AppParams appParams = new AppParams();
            appParams.startupProject = arguments.project;

            App app = new App(new DesktopClassScanner(), appParams);
            LwjglCanvas canvas = new CustomLwjglCanvas(app, config);

            new MainFrame(app, canvas, config);
        }
    });

}
项目:vrmleditor    文件:Editor.java   
/**
 * Creates new form Editor
 */
public Editor() {
    initComponents();

    // menu action listeners
    new MenuFile(this).addActionListeners();
    new MenuEdit(this).addActionListeners();
    new MenuView(this).addActionListeners();
    new MenuHelp(this).addActionListeners();

    // render
    renderer = new Renderer();
    canvas = new LwjglCanvas(renderer, false);

    // input
    canvas.getInput().setInputProcessor(new Input(this, renderer));

    // editor
    history = new History(this);
    properties = new Properties(this, propertySheetPanel);
    jPanelRender.add(canvas.getCanvas());
}
项目:libgdxcn    文件:FlameMain.java   
public FlameMain () {
    super("Flame");
    MathUtils.random = new RandomXS128();
    particleSystem = ParticleSystem.get();
    effect = new ParticleEffect();
    particleSystem.add(effect);
    assetManager = new AssetManager();
    assetManager.setErrorListener(this);
    assetManager.setLoader(ParticleEffect.class, new ParticleEffectLoader(new InternalFileHandleResolver()));
    controllersData = new Array<ControllerData>();

    lwjglCanvas = new LwjglCanvas(renderer = new AppRenderer());
    addWindowListener(new WindowAdapter() {
        public void windowClosed (WindowEvent event) {
            //System.exit(0);
            Gdx.app.exit();
        }
    });

    initializeComponents();

    setSize(1280, 950);
    setLocationRelativeTo(null);
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    setVisible(true);
}
项目:libgdxcn    文件:ParticleEditor.java   
public ParticleEditor () {
    super("Particle Editor");

    lwjglCanvas = new LwjglCanvas(new Renderer());
    addWindowListener(new WindowAdapter() {
        public void windowClosed (WindowEvent event) {
            System.exit(0);
            // Gdx.app.quit();
        }
    });

    initializeComponents();

    setSize(1000, 950);
    setLocationRelativeTo(null);
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    setVisible(true);
}
项目:libgdxcn    文件:Hiero4.java   
public Hiero4 () {
    super("Hiero v4.0 - Bitmap Font Tool");
    Splash splash = new Splash(this, "/splash.jpg", 2000);
    initialize();
    splash.close();

    gamePanel.add(new LwjglCanvas(renderer = new Renderer()).getCanvas());

    prefs = Preferences.userNodeForPackage(Hiero4.class);
    java.awt.Color backgroundColor = EffectUtil.fromString(prefs.get("background", "000000"));
    backgroundColorLabel.setIcon(getColorIcon(backgroundColor));
    renderingBackgroundColor = new Color(backgroundColor.getRed() / 255f, backgroundColor.getGreen() / 255f,
        backgroundColor.getBlue() / 255f, 1);

    boolean useFontList = getFontFile(Font.decode("Arial")) != null;
    fontList.setEnabled(useFontList);
    systemFontRadio.setEnabled(useFontList);
    fontFileRadio.setSelected(!useFontList);
    fontFileText.setText(prefs.get("font.file", ""));

    setVisible(true);
}
项目:touhou-java    文件:ParticleEditor.java   
public ParticleEditor () {
    super("Particle Editor");

    lwjglCanvas = new LwjglCanvas(new Renderer(), false);
    addWindowListener(new WindowAdapter() {
        public void windowClosed (WindowEvent event) {
            System.exit(0);
            // Gdx.app.quit();
        }
    });

    initializeComponents();

    setSize(1000, 950);
    setLocationRelativeTo(null);
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    setVisible(true);
}
项目:touhou-java    文件:Hiero4.java   
public Hiero4 () {
    super("Hiero v4.0 - Bitmap Font Tool");
    Splash splash = new Splash(this, "/splash.jpg", 2000);
    initialize();
    splash.close();

    gamePanel.add(new LwjglCanvas(renderer = new Renderer(), false).getCanvas());

    prefs = Preferences.userNodeForPackage(Hiero4.class);
    java.awt.Color backgroundColor = EffectUtil.fromString(prefs.get("background", "000000"));
    backgroundColorLabel.setIcon(getColorIcon(backgroundColor));
    renderingBackgroundColor = new Color(backgroundColor.getRed() / 255f, backgroundColor.getGreen() / 255f,
        backgroundColor.getBlue() / 255f, 1);

    boolean useFontList = getFontFile(Font.decode("Arial")) != null;
    fontList.setEnabled(useFontList);
    systemFontRadio.setEnabled(useFontList);
    fontFileRadio.setSelected(!useFontList);
    fontFileText.setText(prefs.get("font.file", ""));

    setVisible(true);
}
项目:eamaster    文件:SwingTestRunner.java   
public SwingTestRunner() {
        logger.info("Starting application");


        LwjglApplicationConfiguration configuration = new LwjglApplicationConfiguration();
        configuration.width = 1200;
        configuration.height = 900;
        configuration.samples = 4;

        logger.info("Config is: {}x{}", configuration.width, configuration.height);

        ApplicationListener app = new WheelRenderer();
        lwjglCanvas = new LwjglCanvas(app, configuration);


        logger.info("Application listener used is {}", app.getClass());

        setName("Test frame ooo");

        JButton b = new JButton("lol");
        b.addActionListener(e -> {
            logger.info("Button clicked");
//            ((WheelRenderer) app).doStuff();
//            lwjglCanvas.stop();
//            getContentPane().remove(lwjglCanvas.getCanvas());
        });

        Container c = getContentPane();
        lwjglCanvas.getCanvas().setBounds(0, 0, 1200, 900);
        b.setBounds(900, 0, 100, 900);
        c.add(lwjglCanvas.getCanvas(), BorderLayout.LINE_START);
        c.add(b, BorderLayout.CENTER);

        pack();
        setVisible(true);
        setSize(1300, 900);
        setDefaultCloseOperation(DISPOSE_ON_CLOSE);

    }
项目:libgdxcn    文件:Hiero.java   
public Hiero(String [] args) {
    super("Hiero v3.0 - Bitmap Font Tool");
    Splash splash = new Splash(this, "/splash.jpg", 2000);
    initialize();
    splash.close();

    gamePanel.add(new LwjglCanvas(new Renderer()).getCanvas());

    prefs = Preferences.userNodeForPackage(Hiero.class);
    java.awt.Color backgroundColor = EffectUtil.fromString(prefs.get("background", "000000"));
    backgroundColorLabel.setIcon(getColorIcon(backgroundColor));
    renderingBackgroundColor = new Color(backgroundColor.getRed() / 255f, backgroundColor.getGreen() / 255f,
        backgroundColor.getBlue() / 255f, 1);
    fontList.setSelectedValue(prefs.get("system.font", "Arial"), true);
    fontFileText.setText(prefs.get("font.file", ""));

    java.awt.Color foregroundColor = EffectUtil.fromString(prefs.get("foreground", "ffffff"));
    colorEffect = new ColorEffect();
    colorEffect.setColor(foregroundColor);
    effectsListModel.addElement(colorEffect);
    effectsListModel.addElement(new GradientEffect());
    effectsListModel.addElement(new OutlineEffect());
    effectsListModel.addElement(new OutlineWobbleEffect());
    effectsListModel.addElement(new OutlineZigzagEffect());
    effectsListModel.addElement(new ShadowEffect());
    effectsListModel.addElement(new DistanceFieldEffect());
    new EffectPanel(colorEffect);

    parseArgs(args);

    addWindowListener(new WindowAdapter() {
        public void windowClosed (WindowEvent event) {
            System.exit(0);
            // Gdx.app.quit();
        }
    });

    updateFontSelector();
    setVisible(true);
}
项目:libgdxcn    文件:LwjglCanvasTest.java   
public LwjglCanvasTest () {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    Container container = getContentPane();
    canvas = new LwjglCanvas(new UITest());

    container.add(canvas.getCanvas(), BorderLayout.CENTER);

    pack();
    setVisible(true);
    setSize(800, 480);
}
项目:GdxStudio    文件:Hiero.java   
public Hiero () {
    super("Hiero v3.0 - Bitmap Font Tool");
    Splash splash = new Splash(this, "/splash.jpg", 2000);
    initialize();
    splash.close();

    gamePanel.add(new LwjglCanvas(new Renderer(), false).getCanvas());

    prefs = Preferences.userNodeForPackage(Hiero.class);
    java.awt.Color backgroundColor = EffectUtil.fromString(prefs.get("background", "000000"));
    backgroundColorLabel.setIcon(getColorIcon(backgroundColor));
    renderingBackgroundColor = new Color(backgroundColor.getRed() / 255f, backgroundColor.getGreen() / 255f,
        backgroundColor.getBlue() / 255f, 1);
    fontList.setSelectedValue(prefs.get("system.font", "Arial"), true);
    fontFileText.setText(prefs.get("font.file", ""));

    java.awt.Color foregroundColor = EffectUtil.fromString(prefs.get("foreground", "ffffff"));
    colorEffect = new ColorEffect();
    colorEffect.setColor(foregroundColor);
    effectsListModel.addElement(colorEffect);
    effectsListModel.addElement(new GradientEffect());
    effectsListModel.addElement(new OutlineEffect());
    effectsListModel.addElement(new OutlineWobbleEffect());
    effectsListModel.addElement(new OutlineZigzagEffect());
    effectsListModel.addElement(new ShadowEffect());
    effectsListModel.addElement(new DistanceFieldEffect());
    new EffectPanel(colorEffect);
    setVisible(true);
}
项目:touhou-java    文件:Hiero.java   
public Hiero () {
    super("Hiero v3.0 - Bitmap Font Tool");
    Splash splash = new Splash(this, "/splash.jpg", 2000);
    initialize();
    splash.close();

    gamePanel.add(new LwjglCanvas(new Renderer(), false).getCanvas());

    prefs = Preferences.userNodeForPackage(Hiero.class);
    java.awt.Color backgroundColor = EffectUtil.fromString(prefs.get("background", "000000"));
    backgroundColorLabel.setIcon(getColorIcon(backgroundColor));
    renderingBackgroundColor = new Color(backgroundColor.getRed() / 255f, backgroundColor.getGreen() / 255f,
        backgroundColor.getBlue() / 255f, 1);
    fontList.setSelectedValue(prefs.get("system.font", "Arial"), true);
    fontFileText.setText(prefs.get("font.file", ""));

    java.awt.Color foregroundColor = EffectUtil.fromString(prefs.get("foreground", "ffffff"));
    colorEffect = new ColorEffect();
    colorEffect.setColor(foregroundColor);
    effectsListModel.addElement(colorEffect);
    effectsListModel.addElement(new GradientEffect());
    effectsListModel.addElement(new OutlineEffect());
    effectsListModel.addElement(new OutlineWobbleEffect());
    effectsListModel.addElement(new OutlineZigzagEffect());
    effectsListModel.addElement(new ShadowEffect());
    effectsListModel.addElement(new DistanceFieldEffect());
    new EffectPanel(colorEffect);

    addWindowListener(new WindowAdapter() {
        public void windowClosed (WindowEvent event) {
            System.exit(0);
            // Gdx.app.quit();
        }
    });

    setVisible(true);
}
项目:libGDX-Path-Editor    文件:LwjglPanel.java   
public LwjglPanel(IUIHandler handler) {
    setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
    setLayout(new GridLayout());

    gdxApp = new GdxApp(handler);
    canvas = new LwjglCanvas(gdxApp, true);
    add(canvas.getCanvas());
}