Fixed crash when shaders are not supported
authorSam Lantinga <slouken@libsdl.org>
Wed, 09 Feb 2011 09:36:40 -0800
changeset 5236c7be6ca3a0b8
parent 5235 1e28342cb15d
child 5237 55b31686f82b
Fixed crash when shaders are not supported
test/testshader.c
     1.1 --- a/test/testshader.c	Tue Feb 08 23:13:58 2011 -0800
     1.2 +++ b/test/testshader.c	Wed Feb 09 09:36:40 2011 -0800
     1.3 @@ -181,9 +181,11 @@
     1.4  
     1.5  static void DestroyShaderProgram(ShaderData *data)
     1.6  {
     1.7 -    glDeleteObjectARB(data->vert_shader);
     1.8 -    glDeleteObjectARB(data->frag_shader);
     1.9 -    glDeleteObjectARB(data->program);
    1.10 +    if (shaders_supported) {
    1.11 +        glDeleteObjectARB(data->vert_shader);
    1.12 +        glDeleteObjectARB(data->frag_shader);
    1.13 +        glDeleteObjectARB(data->program);
    1.14 +    }
    1.15  }
    1.16  
    1.17  static SDL_bool InitShaders()
    1.18 @@ -481,3 +483,5 @@
    1.19  }
    1.20  
    1.21  #endif /* HAVE_OPENGL */
    1.22 +
    1.23 +/* vi: set ts=4 sw=4 expandtab: */