First test rendering / skelton Game Loop / utility Textureloader

This commit is contained in:
Gulum
2017-10-24 09:26:44 +02:00
parent 552e4dd0cb
commit eb5c1e4ec3
17 changed files with 425 additions and 16 deletions

View File

@@ -1,11 +1,28 @@
#ifndef DARKRP2D_H
#define DARKRP2D_H
#include <SDL2/SDL.h>
class DarkRP2D {
private:
unsigned int accumulator = 0;
int skippedFrames = 0;
//test texture
SDL_Texture* gTexture = NULL;
public:
void create();
void loop(float deltaTime);
void resize();
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() {}
void create(SDL_Renderer *gRenderer);
void loop(unsigned int deltaTime);
void update(float deltaInSec);
void render(float deltaInSec);
void resize(int width, int height);
void dispose();
};