Package Hexel.rendering

Source Code of Hexel.rendering.Window

package Hexel.rendering;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLProfile;
import javax.media.opengl.awt.GLCanvas;
import javax.swing.JFrame;

public class Window {

  public GLCanvas canvas;

  public GLCanvas getCanvas() {
    return this.canvas;
  }

  public JFrame frame;

  public JFrame getFrame() {
    return this.frame;
  }

  public Window() {
    GLProfile glp = GLProfile.getMinimum(true);
    GLCapabilities caps = new GLCapabilities(glp);
    caps.setDepthBits(24);
    this.canvas = new GLCanvas(caps);

    this.frame = new JFrame("Hexel");
    this.frame.setSize(1280, 800);
    this.frame.add(this.canvas);
    this.frame.setVisible(true);

    this.frame.addWindowListener(new WindowAdapter() {
      @Override
      public void windowClosing(WindowEvent e) {
        System.exit(0);
      }
    });

  }
}
TOP

Related Classes of Hexel.rendering.Window

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.