5 #include <SDL2/SDL_ttf.h> 20 #include "background.h" 23 #include "collision.h" 26 #include "physics-tmp.h" 29 #include "gamestate.h" 41 int simulationTime, realTime;
45 Uint8 red, green, blue;
48 time_t lastTime, curTime;
54 int curFPS, setFPS, lastFrame;
63 void setGravity(
double g) {gravity=g;}
64 void setFrameRate(
int f) {setFPS=f;}
65 double getGravity()
const {
return gravity;}
67 SDL_Renderer* init(
string s,
const int& w,
const int& h,
int flag);
69 SDL_Renderer* init(
string s,
const int& w,
const int& h,
int flag,
int it);
71 SDL_Renderer* init(
string s,
const int& w,
const int& h,
int flag,
int x,
int y);
73 SDL_Renderer* init(
string s,
const int& w,
const int& h,
int flag,
int x,
int y,
int it);
75 void setName(
string s);
77 void setPos(
int x,
int y);
79 void setSize(
int w,
int y);
81 SDL_Renderer* getRenderer();
85 void setColor(Uint8 r, Uint8 g, Uint8 b);
97 void setBackground(
string filename);
101 void drawBackground();
105 void draw(vector<Object> objs);
106 void draw(vector<vector<Object>> objs);
108 void draw(
Object obj,
int key);
110 void draw(
Level lvl);
112 void draw(
const char *text,
int x,
int y,
int r,
int g,
int b);
116 void bypassSplash(
int key);
120 void debugMode(
bool d);
121 void loadFont(
char *font_path);
124 bool getRunning()
const {
return running; }
125 void setRunning(
bool r) { running = r; }
126 void setGLView(
int a,
int b,
int c,
int d,
int e,
int f,
int g,
int h,
int i);
127 void setGLMode(
bool m) {glMode=m; glViewport(0, 0, WIDTH, HEIGHT); }
128 int getFPS()
const {
return curFPS;}
131 void delay(
int time);
132 void enableTransparency() {SDL_SetRenderDrawBlendMode(engren, SDL_BLENDMODE_BLEND);}
134 void setGamestate(
int s) {
if(gs.getGameState()!=0) gs.setGameState(s);}
135 int getGameState() {
return gs.getGameState();}
136 void setSplashColor(
int r,
int g,
int b) {sr=r;sg=g;sb=b;}
This class stores information for an Object in the game.
void setBackground(Background b)
Set background.
Class for declaring an engine, which does basic SDL commands like creating the window and renderer...
Object that is a background image that covers the screen.
SDL_Window * getWindow() const
Returns screen window.
This class stores a Stage and Objects and can move them and display them.
Background getBackground() const
Get background.