PDA

View Full Version : Can't enable Hardware acceleration



EycEwinD
03-02-2001, 10:50 PM
HI
I'm using the following code to setup pixelformat (in Windows using MFC)

BOOL GLStart::SetupPixelFormat (HDC hDC)
{
PIXELFORMATDESCRIPTOR pfd =
{
sizeof(PIXELFORMATDESCRIPTOR),
1,
PFD_SUPPORT_OPENGL |
PFD_DRAW_TO_WINDOW |
PFD_DOUBLEBUFFER,
PFD_TYPE_RGBA,
32,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,
0, 0,
PFD_MAIN_PLANE,
0, 0, 0, 0
};
m_PixelFormat = ChoosePixelFormat (hDC, pfd);
SetPixelFormat (hDC, m_PixelFormat, &pfd);
}

But I am unable to get Hardware acceleration.... Any suggestions...

03-02-2001, 11:32 PM
What card?

EycEwinD
03-03-2001, 05:36 AM
I have a Voodoo3 16MB. I was told to do the following to find out if I was was getting Hardware support.

After you fill out the PIXELFORMATDESCRIPTOR, do the following:

int pixelFormat = ChoosePixelFormat (hDC, &pfd);

PIXELFORMATDESCRIPTOR pfd_new;
DescribePixelFormat (hDC, pixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &pfd_new);

int generic_format = pfd_new.dwFlags & PFD_GENERIC_FORMAT;
int generic_accelerated = pfd_new.dwFlags & PFD_GENERIC_ACCELERATED;

if (generic_format && ! generic_accelerated)
{
// software
}
else if (generic_format&& gneric_accelerated){
// hardware - MCD
}
else if (! generic_format && ! generic_accelerated)
{
// hardware - ICD
}

PS: I'm not using ICD
BTW: What is an "ICD"?

JyrkiHoisko
03-03-2001, 05:39 AM
Originally posted by EycEwinD:
HI
I'm using the following code to setup pixelformat (in Windows using MFC)

BOOL GLStart::SetupPixelFormat (HDC hDC)
{
PIXELFORMATDESCRIPTOR pfd =
{
sizeof(PIXELFORMATDESCRIPTOR),
1,
PFD_SUPPORT_OPENGL |
PFD_DRAW_TO_WINDOW |
PFD_DOUBLEBUFFER,
PFD_TYPE_RGBA,
32,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,
0, 0,
PFD_MAIN_PLANE,
0, 0, 0, 0
};
m_PixelFormat = ChoosePixelFormat (hDC, pfd);
SetPixelFormat (hDC, m_PixelFormat, &pfd);
}

But I am unable to get Hardware acceleration.... Any suggestions...


Download glenum from http://support.microsoft.com/support/kb/articles/Q176/7/52.asp With that program, you can check which pixelformats in your computer are hardware accelerated and which are not.
If you have an old or low-end accelerator, it might not support 32-bit color buffer, but maybe only 16-bit. And note, that although pixelformats using accumulator or stencil buffers might appear as "accelerated", they handle those buffers in software (so very slowly).

-Jyrki.