Could not find a valid pixel format on Vista

Started by Orangy Tang, October 08, 2007, 17:15:02

Previous topic - Next topic

Orangy Tang

I've had someone report a crash when starting my game on a Vista machine. The log from my game is:
Starting Rescue Squad 2 [Build: 762M] at Mon Oct 08 22:44:01 CST 2007
Running with asserts disabled
Running as a local build
Attempting to create screen display...
Running windowed
All available modes:
	640 x 400 x 16 @60Hz
	1366 x 768 x 16 @60Hz
	1280 x 854 x 16 @60Hz
	1365 x 768 x 16 @60Hz
	1360 x 768 x 16 @60Hz
	720 x 480 x 32 @60Hz
	1365 x 768 x 32 @60Hz
	1366 x 768 x 32 @60Hz
	1280 x 854 x 32 @60Hz
	1360 x 768 x 32 @60Hz
	720 x 480 x 16 @60Hz
	640 x 400 x 32 @60Hz
	1280 x 768 x 16 @60Hz
	800 x 600 x 16 @60Hz
	768 x 576 x 32 @60Hz
	640 x 480 x 32 @60Hz
	1024 x 768 x 16 @60Hz
	1280 x 800 x 32 @60Hz
	1440 x 900 x 32 @60Hz
	720 x 400 x 16 @60Hz
	1280 x 800 x 16 @60Hz
	1024 x 768 x 32 @60Hz
	1440 x 900 x 16 @60Hz
	720 x 400 x 32 @60Hz
	800 x 600 x 32 @60Hz
	1280 x 768 x 32 @60Hz
	768 x 576 x 16 @60Hz
	640 x 480 x 16 @60Hz
	864 x 480 x 16 @60Hz
	854 x 480 x 32 @60Hz
	320 x 240 x 16 @60Hz
	853 x 480 x 32 @60Hz
	852 x 480 x 32 @60Hz
	1280 x 720 x 16 @60Hz
	1152 x 864 x 32 @60Hz
	320 x 200 x 32 @60Hz
	512 x 384 x 16 @60Hz
	400 x 300 x 16 @60Hz
	480 x 360 x 32 @60Hz
	512 x 384 x 32 @60Hz
	400 x 300 x 32 @60Hz
	480 x 360 x 16 @60Hz
	864 x 480 x 32 @60Hz
	852 x 480 x 16 @60Hz
	853 x 480 x 16 @60Hz
	320 x 240 x 32 @60Hz
	854 x 480 x 16 @60Hz
	320 x 200 x 16 @60Hz
	1152 x 864 x 16 @60Hz
	1280 x 720 x 32 @60Hz
	640 x 350 x 16 @60Hz
	1024 x 640 x 16 @60Hz
	1024 x 640 x 32 @60Hz
	640 x 350 x 32 @60Hz
Adding fallback mode:
	800 x 600 x 0 @0Hz

Suitable display modes by preference:
	800 x 600 x 32 @60Hz
	800 x 600 x 16 @60Hz
	800 x 600 x 0 @0Hz
Trying mode 800 x 600 x 32 @60Hz
Creating display
Centering @ 320,150
Creating display
Couldn't create display:org.lwjgl.LWJGLException: 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.<init>(WindowsDisplayPeerInfo.java:50)
	at org.lwjgl.opengl.WindowsDisplay.createPeerInfo(WindowsDisplay.java:288)
	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 net.orangytang.AppBase.createDisplay(AppBase.java:118)
	at rescuesquad.RescueSquadGame.run(RescueSquadGame.java:80)
	at rescuesquad.RescueSquadGame.main(RescueSquadGame.java:27)


They get the same crash with the 'basic' test on the lwjgl.org demos page:
C:\Users\George\Documents\Games\LWJA\lwjgl-1.1.2\lwjgl-1.1.2>java -cp .;res;jarlwjgl.jar;jar\lwjgl_test.jar;jar\lwjgl_util.jar;jar\lwjgl_fmod3.jar;jar\lwjgl_de
vil.jar;jar\jinput.jar; -Djava.library.path=native\win32 org.lwjgl.test.WindowCr
eationTest
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 54 display modes
Problem retrieving mode with 640x480x24@-1
Problem retrieving mode with 800x600x24@-1
Problem retrieving mode with 1024x768x24@-1
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.initDC(WindowsDisplayPeerInfo
.java:54)
        at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:150)

        at org.lwjgl.opengl.Display.createWindow(Display.java:260)
        at org.lwjgl.opengl.Display.create(Display.java:742)
        at org.lwjgl.opengl.Display.create(Display.java:694)
        at org.lwjgl.opengl.Display.create(Display.java:676)
        at org.lwjgl.test.WindowCreationTest.initialize(WindowCreationTest.java:
92)
        at org.lwjgl.test.WindowCreationTest.main(WindowCreationTest.java:284)

C:\Users\George\Documents\Games\LWJA\lwjgl-1.1.2\lwjgl-1.1.2>


User's specs are:
Intel 2.0GHz Core 2 Duo
NVidia 8600M GT 256MB
Windows Vista Home Premium
1440x900 32bit 60Hz (second monitor resolution unknown)

They say they've disabled dual monitors, and also tried running in XP compatibility mode, but no luck. Possibly relevant is that they say they've got no 24bit display modes, only 32 and 16 (although IIRC my game should fall back to 16bit colour if need be).

Since they get the same crash in the test app, I'm guessing it's a bug in LWJGL under vista. Any ideas whats going wrong? If you need more information I may be able to pass some requests along.

Cheers

Orangy Tang

Anyone? Has anyone successfully used LWJGL on Vista? ???

Matzon

I know that Elias made a commit to support vista, and I am fairly certain that its in the latest release.
-edit- yup, that fix was in 1.1

Matzon

Quotetarmo|wrk: hmm I had a similar problem some time ago and it was the MS opengl drivers, after installing new ones from ATI it worked fine

Orangy Tang

Cheers, I'll upgrade to the latest and see how things go.

Matzon

but your command line ran 1.1.2 - so it should have the fix already!
Do they have updated drivers ?

Orangy Tang

* Orangy Tang slaps forehead

You're right, they've already tried with 1.1.2 and it didn't work. No word on trying with updated driver yet though...

Btw, how can it fail to find a valid pixel format when I've already passed it a display mode chosen from the list of available modes? IIRC I'm only requesting a colour buffer - no stencil, depth or alpha bits, so it really should be able to create *something*.

Matzon

I agree. Not sure if elias can shed some light on it - they might have some vista info regarding TT

elias

Display modes have nothing to do with opengl contexts and pixel formats, they're merely an extra "service" to allow for fullscreen rendering in lower resolutions than the desktop resolution. The most basic setup is a (borderless) window with OpenGL and no disply mode switching.

As for the reason of the failure, I can only guess at driver problems. We have several vista machines here (my current laptop has a G86 base nvidia card and works fine with TT and LWJGL tests). Try another OpenGL program and see if it can get hw accelerated opengl (http://www.realtech-vr.com/glview/download.html should do it nicely).

- elias

the2bears

Quote from: Orangy Tang on October 10, 2007, 12:50:25
Anyone? Has anyone successfully used LWJGL on Vista? ???

I've been running LWJGL apps on my Vista laptop without any issues... though I'm using LWJGL 0.99 or close to it.

Bill
the2bears - the indie shmup blog