Hi, I just started using LWJGL with eclipse recently and had no problem setting it up on my main computer but for some reason it is not working on my laptop. It’s the same project and everything the only difference I could think of is my main computer is 64bit and my laptop is 32bit, not that I think it would make a difference. I installed LWJGL into my java folder in program files and added the library for the project including the natives so I am at a complete loss. Then I was like hey I’ll just get all the stuff to make android games on my laptop and make java games on my other pc and that crap isn’t working right either… just my luck.
This is the compilation error.
Sep 18, 2013 4:22:27 PM com.base.engine.Main initDisplay
SEVERE: null
org.lwjgl.LWJGLException: Pixel format not accelerated
at org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelFormat(Native Method)
at org.lwjgl.opengl.WindowsPeerInfo.choosePixelFormat(WindowsPeerInfo.java:52)
at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:252)
at org.lwjgl.opengl.Display.createWindow(Display.java:306)
at org.lwjgl.opengl.Display.create(Display.java:848)
at org.lwjgl.opengl.Display.create(Display.java:757)
at org.lwjgl.opengl.Display.create(Display.java:739)
at com.webs.burningtreegames.engine.Main.initDisplay(Main.java:83)
at com.webs.burningtreegames.engine.Main.main(Main.java:22)
Exception in thread "main" java.lang.RuntimeException: No OpenGL context found in the current thread.
at org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124)
at org.lwjgl.opengl.GL11.glMatrixMode(GL11.java:2073)
at com.webs.burningtreegames.engine.Main.initGL(Main.java:68)
at com.webs.burningtreegames.engine.Main.main(Main.java:23)
Throw in the main class from the tutorial I’m doing and like I said its the same as on my gaming pc.
package com.base.engine;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.lwjgl.LWJGLException;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import com.base.game.GameMain;
import static org.lwjgl.opengl.GL11.*;
public class Main
{
private static GameMain gameMain;
public static void main(String[] Args)
{
initDisplay();
initGL();
initGame();
gameLoop();
cleanUp();
}
private static void initGame()
{
gameMain = new GameMain();
}
private static void gameLoop()
{
while(!Display.isCloseRequested())
{
getInput();
update();
render();
}
}
private static void getInput()
{
gameMain.getInput();
}
private static void update()
{
gameMain.update();
}
private static void render()
{
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
gameMain.render();
Display.update();
Display.sync(60);
}
private static void initGL()
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0,Display.getWidth(),0,Display.getHeight(),-1,1);
glMatrixMode(GL_MODELVIEW);
glDisable(GL_DEPTH_TEST);
glClearColor(0,0,0,0);
}
public static void initDisplay()
{
try {
Display.setDisplayMode(new DisplayMode(800,600));
Display.create();
Keyboard.create();
Display.setVSyncEnabled(true);
} catch (LWJGLException e)
{
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, e);
}
}
private static void cleanUp()
{
Display.destroy();
Keyboard.destroy();
}
}