PDA

View Full Version : which graphics cards support openGL



jmboctor
05-04-2000, 11:10 AM
Is there some kind on function or code and let us know if the the graphics card installed in the computer supports openGL?

thanx for any input
Joe

Serge K
05-04-2000, 02:06 PM
If you mean the "hardware" support for OpenGL, and you work in a Windows, you can use this function:

// hDC : a handle to the device context that is associated with the current OpenGL rendering context
bool Check4hwOpenGL( HDC hDC )
{
int iPixelFormat = GetPixelFormat(hDC);

PIXELFORMATDESCRIPTOR pfd;

DescribePixelFormat( hDC, iPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
return !(pfd.dwFlags & PFD_GENERIC_FORMAT);
}

jmboctor
05-05-2000, 11:05 AM
but if I am using glutCreateWindow to create a window, how can I get a handle to the device context type HDC? to pass it to my check4 procedure?

thnx for any input
Joe



Originally posted by Serge K:
If you mean the "hardware" support for OpenGL, and you work in a Windows, you can use this function:

// hDC : a handle to the device context that is associated with the current OpenGL rendering context
bool Check4hwOpenGL( HDC hDC )
{
int iPixelFormat = GetPixelFormat(hDC);

PIXELFORMATDESCRIPTOR pfd;

DescribePixelFormat( hDC, iPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
return !(pfd.dwFlags & PFD_GENERIC_FORMAT);
}

Serge K
05-05-2000, 12:56 PM
The wglGetCurrentDC function obtains a handle to the device context that is associated with the current OpenGL rendering context of the calling thread.

HDC wglGetCurrentDC(VOID);

jmboctor
05-08-2000, 06:17 AM
Thnx a lot for u'r help