Fixed crash when shaders are not supported
authorSam Lantinga <slouken@libsdl.org>
Wed, 09 Feb 2011 09:36:40 -0800
changeset 5236 c7be6ca3a0b8
parent 5235 1e28342cb15d
child 5237 55b31686f82b
Fixed crash when shaders are not supported
test/testshader.c
--- a/test/testshader.c	Tue Feb 08 23:13:58 2011 -0800
+++ b/test/testshader.c	Wed Feb 09 09:36:40 2011 -0800
@@ -181,9 +181,11 @@
 
 static void DestroyShaderProgram(ShaderData *data)
 {
-    glDeleteObjectARB(data->vert_shader);
-    glDeleteObjectARB(data->frag_shader);
-    glDeleteObjectARB(data->program);
+    if (shaders_supported) {
+        glDeleteObjectARB(data->vert_shader);
+        glDeleteObjectARB(data->frag_shader);
+        glDeleteObjectARB(data->program);
+    }
 }
 
 static SDL_bool InitShaders()
@@ -481,3 +483,5 @@
 }
 
 #endif /* HAVE_OPENGL */
+
+/* vi: set ts=4 sw=4 expandtab: */