breakout

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 4dc9ca85df53bd3f9f82c78e7db28f4651d03e58
parent 6498358bb85900f5a443561d690b062cc6f9e307
Author: Christopher Ray Langford <chris@hellocld.com>
Date:   Sun, 25 Aug 2019 18:50:16 -0400

Program runs, issue resides in Quit()

Diffstat:
Msrc/main.c | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/main.c b/src/main.c @@ -64,12 +64,12 @@ int main(int argc, char *argv[]) } SDL_Event event; - int done = 1; + int done = 0; while(!done) { while(SDL_PollEvent(&event)) if(event.type == SDL_QUIT) - done = 0; + done = 1; MoveSprite(); SDL_Delay(100); } @@ -99,6 +99,11 @@ int CreateSprite() } ball.tex = SDL_CreateTextureFromSurface(renderer, temp); + if(ball.tex == NULL) + { + SDL_Log("Failed to create texture from surface: %s\n", SDL_GetError()); + return 2; + } ball.position.x = 0; ball.position.y = 0; ball.position.w = temp->w; @@ -107,6 +112,7 @@ int CreateSprite() ball.velocity.y = 0; SDL_FreeSurface(temp); + SDL_Log("Successfully created sprite!\n"); return 0; }