changeset 5241:c7be6ca3a0b8

Fixed crash when shaders are not supported
author Sam Lantinga <slouken@libsdl.org>
date Wed, 09 Feb 2011 09:36:40 -0800
parents 1e28342cb15d
children 55b31686f82b
files test/testshader.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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: */