D3D8: For render states D3DRS_POINTSPRITEENABLE and
D3DRS_MULTISAMPLEANTIALIAS, use GL_SUPPORT correctly
H. Verbeet
hverbeet at gmail.com
Sat Jan 21 17:28:43 CST 2006
GL_SUPPORT should be used with a member of the GL_SupportedExt enum.
Neither GL_ARB_point_sprite nor GL_ARB_multisample are. Also, there is
no reason to even look at "Value" if an extension isn't supported.
Changelog:
- Use GL_SUPPORT correctly
- Don't check Value before checking the required extension is supported.
-------------- next part --------------
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index 363052d..4952d6e 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -3083,39 +3083,33 @@ HRESULT WINAPI IDirect3DDevice8Impl_Se
}
case D3DRS_POINTSPRITEENABLE :
{
- if(Value) {
- if(GL_SUPPORT(GL_ARB_point_sprite)) {
- glEnable(GL_POINT_SPRITE_ARB);
- checkGLcall("glEnable GL_POINT_SPRITE_ARB");
- } else {
- TRACE("Point sprites cannot be enabled in this version of opengl\n");
- }
+ if (!GL_SUPPORT(ARB_POINT_SPRITE)) {
+ TRACE("Point sprites not supported\n");
+ break;
+ }
+
+ if (Value) {
+ glEnable(GL_POINT_SPRITE_ARB);
+ checkGLcall("glEnable GL_POINT_SPRITE_ARB");
} else {
- if(GL_SUPPORT(GL_ARB_point_sprite)) {
- glDisable(GL_POINT_SPRITE_ARB);
- checkGLcall("glDisable GL_POINT_SPRITE_ARB");
- } else {
- TRACE("Point sprites cannot be disabled in this version of opengl\n");
- }
+ glDisable(GL_POINT_SPRITE_ARB);
+ checkGLcall("glDisable GL_POINT_SPRITE_ARB");
}
break;
}
case D3DRS_MULTISAMPLEANTIALIAS :
{
+ if (!GL_SUPPORT(ARB_MULTISAMPLE)) {
+ TRACE("Multisample antialiasing not supported\n");
+ break;
+ }
+
if(Value) {
- if(GL_SUPPORT(GL_ARB_multisample)) {
- glEnable(GL_MULTISAMPLE_ARB);
- checkGLcall("glEnable GL_MULTISAMPLE_ARB");
- } else {
- TRACE("Multisample antialiasing cannot be enabled in this version of opengl\n");
- }
+ glEnable(GL_MULTISAMPLE_ARB);
+ checkGLcall("glEnable GL_MULTISAMPLE_ARB");
} else {
- if(GL_SUPPORT(GL_ARB_multisample)) {
- glDisable(GL_MULTISAMPLE_ARB);
- checkGLcall("glDisable GL_MULTISAMPLE_ARB");
- } else {
- TRACE("Multisample antialiasing cannot be disabled in this version of opengl\n");
- }
+ glDisable(GL_MULTISAMPLE_ARB);
+ checkGLcall("glDisable GL_MULTISAMPLE_ARB");
}
break;
}
More information about the wine-patches
mailing list