8

I have installed LWJGL into a Java project, and I can't import the Display class.

import org.lwjgl.opengl.display;

Gives a cannot be resolved error.

DisplayMode and other classes are also missing. I can not find any of them in the broswer.

CaffeineToCode
  • 830
  • 3
  • 13
  • 25

2 Answers2

18

The old utility classes like Display, Keyboard, Mouse etc. have been removed in LWJGL3. The libary now uses GLFW for window management, which is more complicated but said to have better performance and more features. Like with OpenGL methods, all glfw methods are static and found in the org.lwjgl.glfw.GLFW class.

Unfortunately, because LWJGL3 is still in development, there aren't many tutorials out there. You can find one (unfinished) here: https://github.com/SilverTiger/lwjgl3-tutorial/wiki. Alternatively you can also look through the documentation, which provides some examples.

EDIT: As of March 2015, there is a new unofficial tutorial series that provides a good introduction to LWJGL3.

EDIT: As of September 2015, a migration guide from LWJGL2 to LWJGL3 is in progress.

Little Helper
  • 1,870
  • 3
  • 12
  • 20
javac
  • 2,431
  • 4
  • 17
  • 26
  • The tutorial link is dead, could someone please point to that tutorial again, if it even still exists somewhere else that is? – Sargon1 Aug 05 '16 at 09:07
0
  1. Create a folder named lwjgl in your project folder
  2. Copy lwjgl.jar, lwjgl_util.jar and slick-util.jar into that folder
  3. Select all three files in that folder and right click them
  4. Select Build-Path --> Add to Build Path
  5. Check if your project now contains the classes you need...

In case you can't start your program, then set the path to natives folder... https://stackoverflow.com/a/27433775/3615725

Also it should be imported as import org.lwjgl.opengl.Display;

EDIT: For LWJGL 3 try this http://www.lwjgl.org/guide

Community
  • 1
  • 1
Ubica
  • 1,011
  • 2
  • 8
  • 18