>Okay I think I found out what was wrong...
>I was calling: result = ChangeDisplaySettings( &dm, CDS_FULLSCREEN);
>needed to call: result = ChangeDisplaySettings( &dm, 0);
>That, (and I think along with twiddling the bit depth to 16,
>pixelformatdescriptor to 16, etc.) was the cause. I now get hardware
>acceleration using ATI cards. This wasn't a problem with TNT or Voodoo3
>cards, so who knows?
Ben, this all seems really suspicious to me. What do you mean by
"twiddling the bit depth..." ? I think it is more desirable to use
CDS_FULLSCREEN than not, because CDS_FULLSCREEN will not mess up people's
desktop icons but 0 will. Did you also try CDS_TEST before?
1. I've heard rumour about this issue. Suppose your application starts up.
It is linked to OPENGL32.DLL. Therefore the OpenGL libraries get
initialised, to the current screen depth. Then you try to change mode to a
different bpp. Perhaps the opengl libraries fail to reinitialise
themselves, and so end up kind of screwed up? Perhaps doing
ChangeDisplaySettings(&dm,CDS_FULLSCREEN) was not enough to reset them?
Perhaps doing ChangeDisplaySettings(&dm,0) is enough to reset them?
- perhaps another solution would be to change screen mode *before* linking
to OPENGL32.DLL? There are two ways you could accomplish this. (1) You
could write a launcher program whose job is to ChangeDisplaySettings and
then run your actual game. Or (2) you could load OPENGL32.DLL dynamically
2. Are you using ChoosePixelFormat? I never trust that call. The most
reliable way for you to choose a pixel format is for you to enumerate them
one by one, and call DescribePixelFormat for each one, and to find out
which ones are accelerated. (by checking PFD_GENERIC_FORMAT and
Try changing screen mode using CDS_FULLSCREEN to something or other (16,
probably). Then enumerate all the pixel formats. Does it tell you that it
can accelerate some of them okay?
I ask because I've done exactly this, on an ATI card (using
CDS_FULLSCREEN, and enumerating the pixel formats, and choosing the one
that was accelerated). And it all appeared to work fine, and I did get