LWJGL
May 20, 2013, 01:37:12 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.9.0 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: Creating of display doesnt work ...  (Read 2410 times)
Trudko
Newbie
*
Posts: 29


« on: November 06, 2006, 12:37:30 »

Creating of display does never work.  The code is very simple so I dont think that I make misstake + I was following the tutorial.

public class BasicOpengl
{

    public static final int  FRAMERATE = 60;
    public static final String GAME_TITLE = "Game";
    public static boolean finished;
    public static float angle;
   
    public static void main(String args[])
    {
        boolean fullscreen = (args.length == 1 && args[0].equals("-fullscreen"));
       
        try {
            init(fullscreen);
         
        } catch (Exception e) {
              e.printStackTrace(System.err);
              Sys.alert(GAME_TITLE, "An error occured and the game will exit.");
        } finally {

        }
          System.exit(0);
    }
   
    private static void init(boolean fullscreen) throws Exception
    {
        Display.setTitle(GAME_TITLE);
        Display.setFullscreen(fullscreen);
       
        Display.setVSyncEnabled(true);
        Display.create();
        while(true)
        {
            Display.update();
        }
       
    }
   
}

Logged
darkprophet
Talks Too Much
***
Posts: 179


« Reply #1 on: November 06, 2006, 17:37:09 »

Nope, thats fine...

The only reason that it isn't blank is because your not clearing the screen...

Before Display.update(); write the following:

Code:

GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);


You have started to get into the nitty gritty of OpenGL, so I would suggest going to nehe and/or looking at the wiki for some tutorials.

Enjoy Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!