I have been trying to display text with ninjacave's tutorials and lot's of others but I can't get it to work. Could someone give me a link to a tutorial that works? Thanks.
The code is below:
Main Class:
package oregon.client;
import oregon.src.*;
import org.lwjgl.*;
import org.lwjgl.opengl.*;
import static org.lwjgl.opengl.GL11.*;
public class Oregon {
public static Settings settings = new Settings();
public GameController controls = new GameController();
public FPSCounter fps = new FPSCounter();
public void init() {
try {
if (settings.fullscreen) {
Display.setDisplayModeAndFullscreen(Display
.getDesktopDisplayMode());
} else if (!settings.fullscreen) {
Display.setDisplayModeAndFullscreen(new DisplayMode(
settings.defaultWidth, settings.defaultHeight));
}
Display.setVSyncEnabled(true);
Display.create();
} catch (LWJGLException e) {
stop(e);
}
initOpenGL();
start();
}
public void initOpenGL() {
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, settings.defaultWidth, settings.defaultHeight, 0, 1, -1);
glMatrixMode(GL_MODELVIEW);
}
public void debug() {
}
public void openGL() {
}
public void start() {
while (!Display.isCloseRequested()) {
controls.keyboard();
fps.tick();
debug();
openGL();
Display.update();
Display.sync(100);
}
Display.destroy();
}
public static void stop() {
System.exit(0);
Display.destroy();
}
public static void stop(Exception e) {
e.printStackTrace();
System.exit(0);
Display.destroy();
}
public static void setFullscreen() {
try {
Display.setDisplayModeAndFullscreen(Display.getDesktopDisplayMode());
} catch (LWJGLException e) {
stop(e);
}
}
public static void removeFullscreen() {
try {
Display.setDisplayModeAndFullscreen(new DisplayMode(
settings.defaultWidth, settings.defaultHeight));
} catch (LWJGLException e) {
stop(e);
}
}
public static void main(String args[]) {
Oregon oregon = new Oregon();
oregon.init();
}
}
That was the code for the main-class.
EDIT:- This is a picture of what I'm getting with Jesse B's code.