OpenGL in hardware mode

I use opengl and visual c++ 6.0. I link shared dll and
use project with opengl32.lib, glu32.lib and glut32.lib.

On two computers with older TNT 2 (win98) and geforce 256(Win XP) card
everything go in hardware mode. But when I try to run program in another
two computers with Geforce MX2, opengl render only is software mode.

Why it goes this way?

I use standard COpenGLWnd class with section:

sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd
1, // version number
PFD_DRAW_TO_WINDOW | // support window
PFD_SUPPORT_OPENGL | // support OpenGL
PFD_DOUBLEBUFFER, // double buffered
24, // 24-bit color depth
0, 0, 0, 0, 0, 0, // color bits ignored
0, // no alpha buffer
0, // shift bit ignored
0, // no accumulation buffer
0, 0, 0, 0, // accumulation bits ignored
16, // 16-bit z-buffer
0, // no stencil buffer
0, // no auxiliary buffer
PFD_MAIN_PLANE, // main layer
0, // reserved
0, 0, 0 // layer masks ignored

The one problem is that the program run on two computers in my home
Another is, that it is my MSC degree program and it runes software
opengl in examiner professor computer.


Try to use color mode of your desctop(32 or 16 bit). New drivers can’t set up GL in 16 bit mode if display runs 32. Maybe you are running 16 bpp while trying to set 24?
Also, I won’t suggest using 24. Use 32 instead.

cColorBits is the number of color bits excluding alpha channel, so for 32 bit RGBA, 24 is the correct value. If you need alpha channel, you specify amount of bits in cAlphaBits.

How to get information about actual color deph in windows in opengl or win api?

Bob, it doesn’t play any matter. If you set color bits to 32 it could be interpretated as 24 for rgb and 8 undefined. Driver will choose it right.
There was a function like GetDesktopSettings(GetScreenSettings) or so. Look in Win32 SDK.