Display error

Started by palmerjj01, January 02, 2015, 15:28:58

Previous topic - Next topic

palmerjj01

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();
         
      }
      
   }

SHC

What is the error you are getting? We can't help you unless you say what is the error you got.

palmerjj01

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

SHC

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.

palmerjj01

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 :/

SHC

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.

palmerjj01