Package org.lwjgl.opengl

Examples of org.lwjgl.opengl.DisplayMode


        return delta;
    }

    private static void setUpDisplay() {
        try {
            Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT));
            Display.setTitle("Pong");
            Display.create();
        } catch (LWJGLException e) {
            e.printStackTrace();
            Display.destroy();
View Full Code Here


public class DisplayTest {

    public static void main(String[] args) {
        try {
            // Sets the width of the display to 640 and the height to 480
            Display.setDisplayMode(new DisplayMode(640, 480));
            // Sets the title of the display to "Episode 2 - Display"
            Display.setTitle("Episode 2 - Display");
            // Creates and shows the display
            Display.create();
        } catch (LWJGLException e) {
View Full Code Here

  {
    // Default at 40 degrees field of view (x-axis)
    fov = 40;

    // Default aspect ratio of the window
    DisplayMode dm = Display.getDisplayMode();
    aspectRatio = dm.getWidth() / dm.getHeight();

    // Default clipping planes (always positive, near never less than 0.1)
    nearClip = 1f;
    farClip = 10000;
    setProjectionMatrix();
View Full Code Here

   * @throws Exception
   */
  public static void initialise(String title, int width, int height)
      throws Exception
  {
    DisplayMode chosenMode = null;
    int targetWidth = 800;
    int targetHeight = 600;

    LogManager logManager = LogManager.getLogManager();
    logManager.readConfiguration();
View Full Code Here

      if (fullscreen) {
        DisplayMode[] modes = Display.getAvailableDisplayModes();
        int freq = 0;
       
        for (int i=0;i<modes.length;i++) {
          DisplayMode current = modes[i];
         
          if ((current.getWidth() == width) && (current.getHeight() == height)) {
            if ((targetDisplayMode == null) || (current.getFrequency() >= freq)) {
              if ((targetDisplayMode == null) || (current.getBitsPerPixel() > targetDisplayMode.getBitsPerPixel())) {
                targetDisplayMode = current;
                freq = targetDisplayMode.getFrequency();
              }
            }

            // if we've found a match for bpp and frequence against the
            // original display mode then it's probably best to go for this one
            // since it's most likely compatible with the monitor
            if ((current.getBitsPerPixel() == originalDisplayMode.getBitsPerPixel()) &&
                (current.getFrequency() == originalDisplayMode.getFrequency())) {
              targetDisplayMode = current;
              break;
            }
          }
        }
      } else {
        targetDisplayMode = new DisplayMode(width,height);
      }
     
      if (targetDisplayMode == null) {
        throw new SlickException("Failed to find value mode: "+width+"x"+height+" fs="+fullscreen);
      }
View Full Code Here

  Texture paloTex;
   
 
  public void start() {
    try {
      Display.setDisplayMode(new DisplayMode(windowWidth, windowHeight));
      Display.create();
    } catch (LWJGLException e) {
      e.printStackTrace();
      System.exit(0);
    }
View Full Code Here

    drawableEntities = new ArrayList<Drawable>();
    buttonEntities = new ArrayList<Drawable>();
   
    //Set up GL11
    try {
      Display.setDisplayMode(new DisplayMode(WINDOW_WIDTH, WINDOW_HEIGHT));
      Display.create();
    } catch (LWJGLException e) {
      e.printStackTrace();
      System.exit(0);
    }
View Full Code Here

   
 
  public void start() {
    GUIScoreMenu.updateLHS();
    try {
      Display.setDisplayMode(new DisplayMode(windowWidth, windowHeight));
      Display.create();
    } catch (LWJGLException e) {
      e.printStackTrace();
      System.exit(0);
    }
View Full Code Here

    drawableEntities = new ArrayList<Drawable>();
    buttonEntities = new ArrayList<Drawable>();
   
    //Set up GL11
    try {
      Display.setDisplayMode(new DisplayMode(WINDOW_WIDTH, WINDOW_HEIGHT));
      Display.setInitialBackground(1, 1, 1); // white background
      Display.create();
    } catch (LWJGLException e) {
      e.printStackTrace();
      System.exit(0);
View Full Code Here

            (int width, int height, boolean fullscreen)
            throws LWJGLException {       
        this.width = width;
        this.height = height;
       
        DisplayMode desktop = Display.getDesktopDisplayMode();

        if ( fullscreen  &&  desktop.isFullscreenCapable() ) {
            Display.setDisplayMode(desktop);
            Display.setFullscreen(true);
           
            this.width = desktop.getWidth();
            this.height = desktop.getHeight();
        } else {
            displaymode = new DisplayMode(this.width, this.height);
            Display.setDisplayMode(displaymode);
        }

        aspect = (float) this.width / (float) this.height;
       
View Full Code Here

TOP

Related Classes of org.lwjgl.opengl.DisplayMode

Copyright © 2018 www.massapicom. 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.