Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm trying to make a simple game in LWJGL but no matter what I do I just get a black screen and it becomes unresponsive. Here is the code that opens the window:

package src;

import org.lwjgl.LWJGLException;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;

import src.Wall.Pos;

import static org.lwjgl.opengl.GL11.*;

public class MyGame {
public void Loop()
{
    Display.setResizable(false);

    Display.setTitle("My Game");

    try
    {
        Display.setDisplayMode(new DisplayMode(640, 480));
        Display.create();
    }
    catch (LWJGLException e)
    {
        e.printStackTrace();
        System.exit(0);
    }

    Wall.Load();

    Wall wall = new Wall(500, 500, 30, Wall.Pos.Vertical);

    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrtho(0, Display.getDisplayMode().getWidth(), 0, Display.getDisplayMode().getHeight(), -1, 1);
    glMatrixMode(GL_MODELVIEW);

    Display.sync(60);

    while(!Display.isCloseRequested())
    {
        glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);

        boolean Up = Keyboard.isKeyDown(Keyboard.KEY_UP);
        boolean Down = Keyboard.isKeyDown(Keyboard.KEY_DOWN);
        boolean Left = Keyboard.isKeyDown(Keyboard.KEY_LEFT);
        boolean Right = Keyboard.isKeyDown(Keyboard.KEY_RIGHT);
        boolean Swap = Mouse.isButtonDown(0);

        wall.RenderWall();
    }

    Display.destroy();
}

}

I don't know what I did wrong but does anyone know why nothing is working?

share|improve this question
2  
Hi there. GDSE considers a question to be "localized" (not relevant to the wider community) if all you're doing is asking us to debug your code for you. – Sean Middleditch Feb 4 at 2:56
1  
... in this particular case, I think the question could be rephrased to be less localised, addressing a real problem, I the title was something other than "not working" (something more googleable) and a minimal code sample was provided. – Liosan Feb 4 at 8:08

closed as too localized by Byte56, Sean Middleditch, Trevor Powell, Josh Petrie, Nicol Bolas Feb 4 at 6:38

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.