org.lwjgl.LWJGLException: Could not find a valid pixel forma

Started by xtboc, September 27, 2006, 10:49:13

Previous topic - Next topic

xtboc

Please i need ur wisdow!!!

i just download the files but at this point i hv had an Exception:


java -cp .;res;jar\lwjgl.jar;jar\lwjgl_test
.jar;jar\lwjgl_util.jar;jar\lwjgl_fmod32.jar;jar\lwjgl_devil.jar;jar\jinput.jar;
-Djava.library.path=native\win32 org.lwjgl.test.WindowCreationTest
The following keys are available:
ESCAPE:         Exit test
ARROW Keys:     Move window when in non-fullscreen mode
L:              List selectable display modes
0-8:            Selection of display modes
F:              Toggle fullscreen
SHIFT-F:        Toggle fullscreen with Display.destroy()/create() cycle
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.libr
ary.path
       at java.lang.ClassLoader.loadLibrary(Unknown Source)
       at java.lang.Runtime.loadLibrary0(Unknown Source)
       at java.lang.System.loadLibrary(Unknown Source)
       at org.lwjgl.Sys$1.run(Sys.java:75)
       at java.security.AccessController.doPrivileged(Native Method)
       at org.lwjgl.Sys.doLoadLibrary(Sys.java:68)
       at org.lwjgl.Sys.loadLibrary(Sys.java:84)
       at org.lwjgl.Sys.<clinit>(Sys.java:101)
       at org.lwjgl.opengl.Display.<clinit>(Display.java:103)
       at org.lwjgl.test.WindowCreationTest.initialize(WindowCreationTest.java:
80)
       at org.lwjgl.test.WindowCreationTest.main(WindowCreationTest.java:284)


OR

java -cp .;res;jar\lwjgl.jar;jar\lwjgl_test
.jar;jar\lwjgl_util.jar;jar\lwjgl_fmod3.jar;jar\lwjgl_devil.jar;jar\jinput.jar;
-Djava.library.path=native\win32 org.lwjgl.test.WindowCreationTest
The following keys are available:
ESCAPE:         Exit test
ARROW Keys:     Move window when in non-fullscreen mode
L:              List selectable display modes
0-8:            Selection of display modes
F:              Toggle fullscreen
SHIFT-F:        Toggle fullscreen with Display.destroy()/create() cycle
Found 22 display modes
Problem retrieving mode with 640x480x24@75
Problem retrieving mode with 640x480x32@75
Problem retrieving mode with 800x600x24@75
Problem retrieving mode with 800x600x32@75
Problem retrieving mode with 1024x768x24@75
Problem retrieving mode with 1024x768x32@75
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.ja
va:52)
       at org.lwjgl.opengl.WindowsDisplayPeerInfo.<init>(WindowsDisplayPeerInfo
.java:50)
       at org.lwjgl.opengl.WindowsDisplay.createPeerInfo(WindowsDisplay.java:28
8)
       at org.lwjgl.opengl.Display.create(Display.java:681)
       at org.lwjgl.opengl.Display.create(Display.java:657)
       at org.lwjgl.opengl.Display.create(Display.java:641)
       at org.lwjgl.test.WindowCreationTest.initialize(WindowCreationTest.java:
92)
       at org.lwjgl.test.WindowCreationTest.main(WindowCreationTest.java:284)



wanna help me please??

Evil-Devil

Have you installed the latest drivers for your graphics card?
and which windows do you use?

darkmoon

One of my beta testers ran into this same problem: LWJGLException: Could not find a valid pixel format
Using beta 3 on WinXP and an NVIDIA GeForce2.

Is this a common problem? Is upgrading the driver a solution, or can/will it be fixed in lwjgl?

Thanks
Bubblomania - free, online, cute and psychedelic arcade game!
My Blog

darkprophet

Are you specifying a particular refresh rate? It seems that you are from the log output (Problem retrieving mode with 640x480x24@75)..

Try and loosen up the refresh rate. If that doesn't help, could you tell us if you are requiring particular capability bits? Like stencil bits or accumulation bits ?

DP

darkmoon

What I did was specify a non-standard display mode: 640x460, without bpp or frequency. Doing nothing special otherwise...
Bubblomania - free, online, cute and psychedelic arcade game!
My Blog

darkprophet

In cases of special formats (like 640x460), you want to do the following:

public void createDisplay() throws LWJGLException {
   DisplayMode mode = new DisplayMode(640,460);
   Display.setDisplayMode(mode);
   Display.create();
}


Enjoy :)

darkmoon

That's exactly what I did, and it caused a 'LWJGLException: Could not find a valid pixel format' for some people...

So, back to my original question: what can be done about this exception?
Bubblomania - free, online, cute and psychedelic arcade game!
My Blog

Matzon

enumerating the modes and locating one that matches or use the pixelformat constructor in Display.create and setting alpha, depth and/or stencil

darkmoon

Thanks Matzon!
I changed some gfx to fit 640x480 now and choose a matching display mode, but I have yet to hear from my tester...
Bubblomania - free, online, cute and psychedelic arcade game!
My Blog

ndhb

Remember to supply some fallback alternatives. Some drivers, on some platforms (eg. Linux ATI driver wants a 24 bit pixelformat, while on most others wants a 32 bit pixelformat). I.e. catch this exception and try some alternatives before giving up (or you will hear from your testers in the future).

darkmoon

Thanks for the advice, Nicolai!
I rewrote my code once again, and now I'm using the org.lwjgl.util.Display class :)
Unfortunately I only have a few testers, and none of them have Linux...
Bubblomania - free, online, cute and psychedelic arcade game!
My Blog

ndhb

People on the IRC channel are usually happy to perform a small functional test (especially if you provide webstart). I know some of them uses Linux regularly, I only use it myself when testing some experimental features.