Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fixed crash when shaders are not supported

  • Loading branch information
slouken committed Feb 9, 2011
1 parent 45f308b commit b55b301614749ba5bf1f83e62e3f0e392cc981e5
Showing with 7 additions and 3 deletions.
  1. +7 −3 test/testshader.c
@@ -181,9 +181,11 @@ static SDL_bool CompileShaderProgram(ShaderData *data)

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 @@ main(int argc, char *argv[])
}

#endif /* HAVE_OPENGL */

/* vi: set ts=4 sw=4 expandtab: */

0 comments on commit b55b301

Please sign in to comment.