LWJGL Forum

Programming => General Java Game Development => Topic started by: palmerjj01 on January 02, 2015, 15:28:58

Title: Display error
Post by: palmerjj01 on January 02, 2015, 15:28:58
I am having an issue when developing my Flappy Pizza game! I am new to java and am following a tutorial at the moment but I cannot get this section to work without an error.

public void run() {
      try {
      Display.setDisplayMode(new DisplayMode(width, height));
      } catch (LWJGLException e) {
         e.printStackTrace();
         
      }
      
   }
Title: Re: Display error
Post by: SHC on January 02, 2015, 15:30:13
What is the error you are getting? We can't help you unless you say what is the error you got.
Title: Re: Display error
Post by: palmerjj01 on January 02, 2015, 15:41:32
Quote from: SHC on January 02, 2015, 15:30:13
What is the error you are getting? We can't help you unless you say what is the error you got.

The one for Display.setDisplayMode(new DisplayMode(width, height)); is: Add arguments to match 'DisplayMode(int, int, int, int)'
but when I do that it just gives more errors

The error for  } catch (LWJGLException e) { is: Create class 'LWJGLException' .

TheChernoProject did not get the error and I did the same as him
Title: Re: Display error
Post by: SHC on January 02, 2015, 15:53:21
You had got the wrong import, you have imported java.awt.DisplayMode I think, change that to org.lwjgl.opengl.DisplayMode and it should work.
Title: Re: Display error
Post by: palmerjj01 on January 02, 2015, 16:30:53
Quote from: SHC on January 02, 2015, 15:53:21
You had got the wrong import, you have imported java.awt.DisplayMode I think, change that to org.lwjgl.opengl.DisplayMode and it should work.

It cannot even find that import :/
Title: Re: Display error
Post by: SHC on January 02, 2015, 16:43:44
Are you using LWJGL 3? If so you have to use GLFW, most of the other tutorials online are for LWJGL 2. In the case that you are using LWJGL 3, I'm writing a tutorial series on my site. You can find them here (http://goharsha.com/lwjgl-tutorial-series/).
Title: Re: Display error
Post by: palmerjj01 on January 02, 2015, 16:52:26
Thanks,