pixel format

Hi,

I’ve been following the 1st and 2nd OpenGL tutorials on nehe on a WinNT box using VC++6. The example runs, however if I try full screen mode, I get the error which is roughly, “Can’t find suitable pixel format”, then in the window mode the image is grainy and it appears that not all colours are being displayed properly.
Any help would be greatly appreciated,

Thanks,

TAH

your card cant do the pixel format u asked of it.
so what u need to do is enumerate through all the pixel formats and choose the one closest to what u want

[QUOTE]Originally posted by tah:
[b]Hi,

I’ve been following the 1st and 2nd OpenGL tutorials on nehe on a WinNT box using VC++6. The example runs, however if I try full screen mode, I get the error which is roughly, "Can’t find suitable pixel

Try to change the color depth of your desktop.

Ok thanks for the replys, I’m still a bit confused.

“none” I’m not sure what you mean by try to change the colour depth of your desktop, do i do this in my system settings or in the program I write.

Zed I’m not sure what the possibilities are for me to enumerate through.

Thanks

what’s happening is that the call to ChoosePixelFormat( ) is unable to find a pixelformat close enough to the requested one (because your card doesn’t support it).

the only way around it is, as the other post said, is to enumerate the video modes, and choose which one is closest.

basically how u do that is to call Describe PixelFormat(), changing the iPixelFormat( 2nd ) parameter, and check the returned PFD, storing the format number and the PFD in a linked list. (the list is the actual enumeration).

all you do next is choose which pfd is closest, and call SetPixelFormat( ) w/ the pixelformat’s number and PFD.

okay, here’s where i’m lost, usually ChoosePixelFormat() does this for you, and returns the index into the closest matching pixel format…

why it’s not doing this is beyond me, my only speculation is that, maybe, your requesting a 24 bit color depth, your card only supports 8 bits, and when you try to set the, say, 4th supported pixel format( which is 8 bit) using a 24 bit pfd, windows gets mad. (or some such variation of bits and what not )

i’m not sure how to fix it, but that’s what the problem is.

hope it helps…

Originally posted by tah:
[b]Ok thanks for the replys, I’m still a bit confused.

“none” I’m not sure what you mean by try to change the colour depth of your desktop, do i do this in my system settings or in the program I write.

Zed I’m not sure what the possibilities are for me to enumerate through.

Thanks [/b]

change the colour depth in your system settings to 16 bit. Right click on the desktop or use the control panel.

Unforunatly zed I’m on an NT Box and I think I’ve be disallowed to change this setting. Is there anything else I could do?