PDA

View Full Version : wglCreateContext crashes on MATROX



Legolas
12-09-2003, 11:47 PM
Hi all,

i have some strange problem with MATROX graphic cards. The call of wglCreateContext
will cause a crash. At the same time, i got
a strange message in debug ouput:

00000006 12.76177978 ************************************************** *****************************
00000007 12.76178201 *
00000008 12.76178481 * A driver is mapping physical memory 0007B000->00095FFF
00000009 12.76178760 * that it does not own. This can cause internal CPU corruption.
00000010 12.76179012 * A checked build will stop in the kernel debugger
00000011 12.76179263 * so this problem can be fully debugged.
00000012 12.76179459 *
00000013 12.76179822 ************************************************** *****************************

Here's my code:

PIXELFORMATDESCRIPTOR pfd;
int PixelFormat;

memset(&pfd, 0, sizeof(pfd));
pfd.nSize = sizeof(pfd);
pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 24;
pfd.cRedBits = 8;
pfd.cGreenBits = 8;
pfd.cBlueBits = 8;
pfd.cDepthBits = 8;

pfd.cAccumBits = 24;
pfd.cAccumRedBits = 8;
pfd.cAccumGreenBits = 8;
pfd.cAccumBlueBits = 8;

PixelFormat = ChoosePixelFormat(_hdc, &pfd);
if(PixelFormat == 0)
{
return;
}

if(SetPixelFormat(_hdc, PixelFormat, &pfd) ==FALSE)
{
return;
}

if((_hglrc = wglCreateContext(_hdc)) == NULL)
{
return;
}

wglMakeCurrent(_hdc, _hglrc);


On other graphic devices (ATI & GEFORCE), i have no problems.

More strangely, if i change my system display
to 24bit (instead of 32bit), it even works on MATROX.


Does anyone have a hint ?

AdrianD
12-10-2003, 11:23 AM
looks like a driver bug.

Zengar
12-10-2003, 11:30 AM
cDepthBits is 8?
Is it not a bit small?

Legolas
12-10-2003, 11:05 PM
Ähm, depthsBits is not colorBits. So, 8 should be enough, or not ?

ZbuffeR
12-11-2003, 03:22 AM
Originally posted by Legolas:
Ähm, depthsBits is not colorBits. So, 8 should be enough, or not ?
Depth buffer is at least 16 or 24 bits... else you have only 256 different depths and it would be ugly.
You may have to do 24bits depth for 24b color, and 16b depth for 16b color.

EDIT: and there are very few cards with HW accelerated accum buffer.

[This message has been edited by ZbuffeR (edited 12-11-2003).]

Legolas
12-11-2003, 06:48 AM
Ok, agreed. But setting accum buffer bits
won't lead to crash at wglCreateContext, doesnt it? Then i wonder, why SetPixelFormat don't report an error before.

ZbuffeR
12-11-2003, 07:36 AM
Originally posted by Legolas:
But setting accum buffer bits
won't lead to crash at wglCreateContext, doesnt it?
Maybe Matrox Gl drivers are not as stable as nvidia's nor ati's...

V-man
12-11-2003, 10:14 AM
They have user groups at matrox.com so you can ask about it there.

You should not set your desktop on 24 bit. For getting hw acceleration, it should be 16 or 32. Maybe that's why it doesn't crash with 24