Hello Guest

Display error

  • 6 Replies
  • 7485 Views
Display error
« 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();
         
      }
      
   }

*

Offline SHC

  • **
  • 94
    • GoHarsha.com
Re: Display error
« Reply #1 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.

Re: Display error
« Reply #2 on: January 02, 2015, 15:41:32 »
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

*

Offline SHC

  • **
  • 94
    • GoHarsha.com
Re: Display error
« Reply #3 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.

Re: Display error
« Reply #4 on: January 02, 2015, 16:30:53 »
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 :/

*

Offline SHC

  • **
  • 94
    • GoHarsha.com
Re: Display error
« Reply #5 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.

Re: Display error
« Reply #6 on: January 02, 2015, 16:52:26 »
Thanks,