32 lines
737 B
C++
32 lines
737 B
C++
#ifndef DARKRP2D_H
|
|
#define DARKRP2D_H
|
|
|
|
#include <SDL2/SDL.h>
|
|
#include "input/InputHandler.h"
|
|
|
|
class DarkRP2D {
|
|
private:
|
|
unsigned int accumulator = 0;
|
|
int skippedFrames = 0;
|
|
//test texture
|
|
SDL_Texture* gTexture = NULL;
|
|
InputHandler *inputHandler;
|
|
|
|
public:
|
|
static const int UPDATES_PER_SECOND = 60;
|
|
static const unsigned int MS_PER_UPDATE = 17; // 1 / UPDATES_PER_SECOND ~ 16,777777777
|
|
static const int MAX_FRAMESKIP = 5;
|
|
|
|
SDL_Renderer* gRenderer = NULL;
|
|
|
|
DarkRP2D() {}
|
|
~DarkRP2D();
|
|
void create(SDL_Renderer *gRenderer, InputHandler *inputHandler);
|
|
void loop(unsigned int deltaTime);
|
|
void update(float deltaInSec);
|
|
void render(float deltaInSec);
|
|
void resize(int width, int height);
|
|
};
|
|
|
|
#endif // DARKRP2D_H
|