PDA

View Full Version : About Voodoo5 Video Card



Rong Yao
01-04-2001, 06:09 AM
I changed my video card recently, the new one is 3dfx Voodoo5. Now a problem appears. I find the function wglDeleteContext(hRC) does not work well. If I run our application in debug mood(Go F5) in Microsoft Visual Studio, it will go inside assembly code when this function(wglDeleteContext(hRC) ) is called. Although I can still go ahead, it is annoying. Is there anyone who know how to solve the problem? Please advise. Thanks a lot. My email is: yjzr@yahoo.com.

FoxDie
01-04-2001, 12:34 PM
And where you've this problem?
Try this :
To hRc assign wglCreateContext(hDC) then
call wglMakeCurrent(hDC,hRc);

[This message has been edited by FoxDie (edited 01-04-2001).]

Rong Yao
01-04-2001, 01:32 PM
Thank you! I did it in my code, it does not work. Now something more serious happened: When I run our program in release, it just crashs! The problem comes from 3DFXOGL.DLL. Any suggestion?

FoxDie
01-04-2001, 02:54 PM
Now you must set pixelformatdescriptor.
Example:
PIXELFORMATDESCRIPTOR pfd;
int iFormat;

ZeroMemory( pfd, 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.cDepthBits= 16;
pfd.iLayerType= PFD_MAIN_PLANE;
iFormat= ChoosePixelFormat(hDC,PFD);
SetPixelFormat( hDC, iFormat, pfd );

[This message has been edited by FoxDie (edited 01-04-2001).]

Rong Yao
01-08-2001, 12:57 PM
Thank you for your help. Here is my code, I am not sure if there is some problem. It works fine with other video card.

static PIXELFORMATDESCRIPTOR pfd =
{
sizeof(PIXELFORMATDESCRIPTOR),
1,
PFD_DRAW_TO_WINDOW |PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER,
PFD_TYPE_RGBA, 32, // 32-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, // accum bits ignored
32, // 32-bit z-buffer
0, // no stencil buffer
0, // no auxiliary buffer
PFD_MAIN_PLANE, // main layer
0, // reserved
0, 0, 0 // layer masks ignored
};

int pixelformat;
if ( (pixelformat = ChoosePixelFormat(m_pCDC->GetSafeHdc(), &pfd)) == 0 )
{
AfxMessageBox("ChoosePixelFormat failed");
return FALSE;
}
if (SetPixelFormat(m_pCDC->GetSafeHdc(), pixelformat, &pfd) == FALSE)
{
pixelformat = 1;
if (DescribePixelFormat(m_pCDC->GetSafeHdc(), pixelformat, sizeof(PIXELFORMATDESCRIPTOR), &pfd)==0)
{
AfxMessageBox("SetPixelFormat failed (no OpenGL compatible video mode)");
return FALSE;
}
}


Thanks!