Commit 483803ff authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

Added retrieval of ATI info.

parent e3a37c8a
...@@ -703,6 +703,7 @@ typedef enum _GL_Vendors { ...@@ -703,6 +703,7 @@ typedef enum _GL_Vendors {
typedef enum _GL_Cards { typedef enum _GL_Cards {
CARD_WINE = 0x0, CARD_WINE = 0x0,
CARD_ATI_RADEON_8500 = 0x514c, CARD_ATI_RADEON_8500 = 0x514c,
CARD_ATI_RADEON_9700PRO = 0x4e44,
CARD_ATI_RADEON_9800PRO = 0x4e48, CARD_ATI_RADEON_9800PRO = 0x4e48,
CARD_NVIDIA_GEFORCE4_TI4600 = 0x0250, CARD_NVIDIA_GEFORCE4_TI4600 = 0x0250,
CARD_NVIDIA_GEFORCEFX_5900ULTRA = 0x0330 CARD_NVIDIA_GEFORCEFX_5900ULTRA = 0x0330
......
...@@ -227,7 +227,7 @@ HRESULT WINAPI IDirect3D8Impl_GetAdapterIdentifier (LPDIRECT3D8 iface, ...@@ -227,7 +227,7 @@ HRESULT WINAPI IDirect3D8Impl_GetAdapterIdentifier (LPDIRECT3D8 iface,
/* If we don't know the device settings, go query them now */ /* If we don't know the device settings, go query them now */
if (This->isGLInfoValid == FALSE) { if (This->isGLInfoValid == FALSE) {
WineD3D_Context* ctx = WineD3DCreateFakeGLContext(); WineD3D_Context* ctx = WineD3DCreateFakeGLContext();
if (NULL != ctx) IDirect3D8Impl_FillGLCaps(iface, NULL); if (NULL != ctx) IDirect3D8Impl_FillGLCaps(iface, ctx->display);
WineD3DReleaseFakeGLContext(ctx); WineD3DReleaseFakeGLContext(ctx);
} }
if (This->isGLInfoValid == TRUE) { if (This->isGLInfoValid == TRUE) {
...@@ -884,7 +884,7 @@ static void IDirect3D8Impl_FillGLCaps(LPDIRECT3D8 iface, Display* display) { ...@@ -884,7 +884,7 @@ static void IDirect3D8Impl_FillGLCaps(LPDIRECT3D8 iface, Display* display) {
int major, minor; int major, minor;
ICOM_THIS(IDirect3D8Impl,iface); ICOM_THIS(IDirect3D8Impl,iface);
if (This->gl_info.bIsFilled) return ; if (This->gl_info.bIsFilled) return;
This->gl_info.bIsFilled = 1; This->gl_info.bIsFilled = 1;
TRACE_(d3d_caps)("(%p, %p)\n", This, display); TRACE_(d3d_caps)("(%p, %p)\n", This, display);
...@@ -936,12 +936,38 @@ static void IDirect3D8Impl_FillGLCaps(LPDIRECT3D8 iface, Display* display) { ...@@ -936,12 +936,38 @@ static void IDirect3D8Impl_FillGLCaps(LPDIRECT3D8 iface, Display* display) {
break; break;
} }
case VENDOR_ATI: case VENDOR_ATI:
major = minor = 0;
gl_string_cursor = strchr(gl_string, '-');
if (gl_string_cursor++) {
int error = 0;
/* Check if version number is of the form x.y.z */
if (*gl_string_cursor > '9' && *gl_string_cursor < '0')
error = 1;
if (!error && *(gl_string_cursor+2) > '9' && *(gl_string_cursor+2) < '0')
error = 1;
if (!error && *(gl_string_cursor+4) > '9' && *(gl_string_cursor+4) < '0')
error = 1;
if (!error && *(gl_string_cursor+1) != '.' && *(gl_string_cursor+3) != '.')
error = 1;
/* Mark version number as malformed */
if (error)
gl_string_cursor = 0;
}
if (!gl_string_cursor)
WARN_(d3d_caps)("malformed GL_VERSION (%s)\n", debugstr_a(gl_string));
else {
major = *gl_string_cursor - '0';
minor = (*(gl_string_cursor+2) - '0') * 256 + (*(gl_string_cursor+4) - '0');
}
break;
default: default:
major = 0; major = 0;
minor = 9; minor = 9;
} }
This->gl_info.gl_driver_version = MAKEDWORD_VERSION(major, minor); This->gl_info.gl_driver_version = MAKEDWORD_VERSION(major, minor);
FIXME_(d3d_caps)("found GL_VERSION (%s)->(0x%08lx)\n", debugstr_a(gl_string), This->gl_info.gl_driver_version);
gl_string = glGetString(GL_RENDERER); gl_string = glGetString(GL_RENDERER);
strcpy(This->gl_info.gl_renderer, gl_string); strcpy(This->gl_info.gl_renderer, gl_string);
...@@ -956,15 +982,21 @@ static void IDirect3D8Impl_FillGLCaps(LPDIRECT3D8 iface, Display* display) { ...@@ -956,15 +982,21 @@ static void IDirect3D8Impl_FillGLCaps(LPDIRECT3D8 iface, Display* display) {
} }
break; break;
case VENDOR_ATI: case VENDOR_ATI:
if (strstr(This->gl_info.gl_renderer, "RADEON 9800 PRO")) {
This->gl_info.gl_card = CARD_ATI_RADEON_9800PRO;
} else if (strstr(This->gl_info.gl_renderer, "RADEON 9700 PRO")) {
This->gl_info.gl_card = CARD_ATI_RADEON_9700PRO;
} else {
This->gl_info.gl_card = CARD_ATI_RADEON_8500; This->gl_info.gl_card = CARD_ATI_RADEON_8500;
}
break; break;
default: default:
This->gl_info.gl_card = CARD_WINE; This->gl_info.gl_card = CARD_WINE;
break; break;
} }
FIXME_(d3d_caps)("found GL_VERSION (0x%08lx)\n", This->gl_info.gl_driver_version);
FIXME_(d3d_caps)("found GL_RENDERER (%s)->(0x%04x)\n", debugstr_a(This->gl_info.gl_renderer), This->gl_info.gl_card); FIXME_(d3d_caps)("found GL_RENDERER (%s)->(0x%04x)\n", debugstr_a(This->gl_info.gl_renderer), This->gl_info.gl_card);
/* /*
* Initialize openGL extension related variables * Initialize openGL extension related variables
* with Default values * with Default values
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment