Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed crash when shaders are not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Feb 9, 2011
1 parent 45f308b commit b55b301
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/testshader.c
Expand Up @@ -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()
Expand Down Expand Up @@ -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.