Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I followed some advices to learn Slick2D and when I started doing the "SimpleGame" I got my first error. Does anyone have any idea of what is it and how to fix?

Sun Dec 26 23:09:12 GMT-03:00 2010 INFO:Slick Build #274
Sun Dec 26 23:09:12 GMT-03:00 2010 INFO:LWJGL Version: 2.0b1
Sun Dec 26 23:09:12 GMT-03:00 2010 INFO:OriginalDisplayMode: 1024 x 768 x 16 @60Hz
Sun Dec 26 23:09:12 GMT-03:00 2010 INFO:TargetDisplayMode: 800 x 600 x 0 @0Hz
Sun Dec 26 23:09:12 GMT-03:00 2010 ERROR:Could not find a valid pixel format
org.lwjgl.LWJGLException: Could not find a valid pixel format
 at org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelFormat(Native Method)
 at org.lwjgl.opengl.WindowsPeerInfo.choosePixelFormat(WindowsPeerInfo.java:52)
 at org.lwjgl.opengl.WindowsDisplayPeerInfo.initDC(WindowsDisplayPeerInfo.java:54)
 at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:158)
 at org.lwjgl.opengl.Display.createWindow(Display.java:299)
 at org.lwjgl.opengl.Display.create(Display.java:848)
 at org.lwjgl.opengl.Display.create(Display.java:800)
 at org.newdawn.slick.AppGameContainer.tryCreateDisplay(AppGameContainer.java:299)
 at org.newdawn.slick.AppGameContainer.access$000(AppGameContainer.java:34)
 at org.newdawn.slick.AppGameContainer$2.run(AppGameContainer.java:364)
 at java.security.AccessController.doPrivileged(Native Method)
 at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:345)
 at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314)
 at SimpleGame.main(SimpleGame.java:38)
Exception in thread "main" org.newdawn.slick.SlickException: Failed to initialise the LWJGL display
 at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:375)
 at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314)
 at SimpleGame.main(SimpleGame.java:38)
share|improve this question

2 Answers 2

up vote 2 down vote accepted

Did a quick Bing search and got the following forum post and another one. Note that the problem is Failed to initialise the LWJGL display and according to both forums this could be fixed by adding the following line:

-Dorg.lwjgl.opengl.Display.allowSoftwareOpenGL=true

to the VM Arguments of your IDE. I am not a Java developer, so I am not sure if this is the best way to do this.

share|improve this answer
    
I'll try that too. Thanks! ps: didn't know people use Bing to search instead of google –  pringlesinn Dec 27 '10 at 17:03
    
@pringlesinn I actually use both search engines. I have been mostly using Bing recently, but sometimes switch to Google when I don't get good results for a certain query :) –  Waleed Al-Balooshi Dec 27 '10 at 18:39
    
It worked just fine! Thanks. –  pringlesinn Dec 27 '10 at 21:05
    
@pringlesinn I am happy everything worked out and good luck with learning Slick2D :) –  Waleed Al-Balooshi Dec 27 '10 at 21:14
    
This doesn't seem like a great idea, software OpenGL is too slow for anything other than quick experiments. –  user744 Dec 27 '10 at 23:44

I am totally unfamiliar with Slick2D, but it looks like you're requesting a 800x600 fullscreen resolution when your monitor / video card only supports 1024x768.

share|improve this answer
    
Once I get home I'll try it, and I'll let you know. –  pringlesinn Dec 27 '10 at 14:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.