diff options
author | Matt Turner <mattst88@gmail.com> | 2008-06-06 19:57:22 +0000 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2008-06-06 19:57:22 +0000 |
commit | 808faafc08b70b4b655499a9505a2ed06f1c4789 (patch) | |
tree | aedd724c913be0dd274ad096d76ef416baedff9d /glpong.c | |
parent | 1f714742e2dc53445f9979980e4b2e74c5bdcf8f (diff) |
git-svn-id: svn://mattst88.com/svn/glpong/trunk@18 449aeecc-241a-0410-943f-e2f883e2d7a2
Diffstat (limited to 'glpong.c')
-rw-r--r-- | glpong.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -20,6 +20,7 @@ static GLuint SDL_GL_NPOTSurfaceToTexture(SDL_Surface * surface, GLfloat * wrati int main(int argc, char * argv[]) { + Ball_t * temp; GLPong_t GLPong = { NULL, NULL, @@ -60,7 +61,12 @@ int main(int argc, char * argv[]) { GLPong_BallAdd(&GLPong.balls); break; case GLPONG_DELETEBALL: -/* GLPong_BallDelete(GLPong.balls, GLPong.balls);*/ + if (GLPong.balls) { + temp = GLPong.balls; + GLPong.balls = GLPong.balls->next; + free(temp); + } + printf("%d balls\n", length(GLPong.balls)); break; } GLPong_BallMoveAll(&GLPong.balls); @@ -78,15 +84,13 @@ int main(int argc, char * argv[]) { SDL_GL_SwapBuffers(); /* end drawing */ - - - + SDL_Delay(10); } - + /* clean up */ GLPong_Deinit(&GLPong); - + return 0; } |