Fixed some includes, syntax, increased frame rate

This commit is contained in:
Joe Adams 2018-01-12 10:25:01 +00:00
parent 51c9eae76f
commit 7f39731cb7
4 changed files with 9 additions and 2 deletions

View File

@ -131,7 +131,7 @@ int main(void) {
*/ */
char subSteps = 1; // Draw every N+1 frames, thereby calculating movement more precisely char subSteps = 1; // Draw every N+1 frames, thereby calculating movement more precisely
int targetFPS = 60; // Limit FPS to this value, to stop unneccessary calculations int targetFPS = 90; // Limit FPS to this value, to stop unneccessary calculations
char moveX=0; // Toggled between -1, 0 and 1 by keypresses later char moveX=0; // Toggled between -1, 0 and 1 by keypresses later

View File

@ -1,3 +1,5 @@
typedef struct coord { typedef struct coord {
double x; double x;
double y; double y;
@ -45,4 +47,4 @@ typedef struct brickCD {
int height; int height;
struct brickCD *container; struct brickCD *container;
int brickID; int brickID;
} brickCD; } brickCD;

View File

@ -1,9 +1,13 @@
#ifdef _WIN32 #ifdef _WIN32
#include <Windows.h>
#include <SDL.h> #include <SDL.h>
#else #else
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
#endif #endif
#include <gl/GL.h>
#include <gl/GLU.h>
#include "include/structs.h" #include "include/structs.h"
#include "include/paddleAndBall.h"
#include "include/utilityFunctions.h" #include "include/utilityFunctions.h"
void updatePaddle(Uint32 tickrate, paddle *thePaddle, char moveX, int winWidth, int winHeight) { void updatePaddle(Uint32 tickrate, paddle *thePaddle, char moveX, int winWidth, int winHeight) {

View File

@ -15,6 +15,7 @@
#include <math.h> #include <math.h>
#include "include/structs.h" #include "include/structs.h"
#include "include/paddleAndBall.h"
void drawText(const char *text, TTF_Font *font, SDL_Color txtColour, coord loc) { void drawText(const char *text, TTF_Font *font, SDL_Color txtColour, coord loc) {
SDL_Surface *text_surface = TTF_RenderUTF8_Blended(font, text, txtColour); SDL_Surface *text_surface = TTF_RenderUTF8_Blended(font, text, txtColour);