First test rendering / skelton Game Loop / utility Textureloader
This commit is contained in:
@@ -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();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user