Fixed issue with function definition mismatch. Created a basic timer; starting work on issue #1
This commit is contained in:
parent
f08b0d5b75
commit
c2bb045d5e
Binary file not shown.
@ -19,7 +19,7 @@ typedef struct colour {
|
||||
|
||||
void updateBall(double *ballX, double *ballY, double *ballVX, double *ballVY, double paddleX, int paddleWidth, int winWidth, int winHeight);
|
||||
|
||||
void drawPaddle(double paddleX, int paddleWidth, int paddleHeight, colour *c);
|
||||
void drawPaddle(double paddleX, int paddleWidth, int winWidth, int winHeight, colour *c);
|
||||
void drawBall(double ballX, double ballY, colour *c);
|
||||
void drawBg(int winWidth, int winHeight, colour *c1, colour *c2);
|
||||
|
||||
@ -135,9 +135,21 @@ int main(void) {
|
||||
* Let's go!
|
||||
* ----------------
|
||||
*/
|
||||
|
||||
|
||||
|
||||
go=1;
|
||||
while(go) {
|
||||
/* ----------------
|
||||
* Timing control
|
||||
* ----------------
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
Uint32 tickspassed=SDL_GetTicks()-timer;
|
||||
timer=SDL_GetTicks();
|
||||
int fps=1000/(tickspassed+1);
|
||||
printf("Time to draw: %u, fps: %i \r", tickspassed, fps); fflush(stdout);
|
||||
|
||||
/*
|
||||
* ----------------
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user