53 lines
1000 B
C
53 lines
1000 B
C
|
#ifndef DEF_SDLTL_H
|
||
|
|
||
|
#define DEF_SDLTL_H
|
||
|
|
||
|
/* [LIBS] Internes
|
||
|
=========================================================*/
|
||
|
#include "SDL.h"
|
||
|
|
||
|
/* [LIBS] Externes
|
||
|
=========================================================*/
|
||
|
|
||
|
|
||
|
/* [NS] Namespaces
|
||
|
=========================================================*/
|
||
|
using namespace std;
|
||
|
|
||
|
|
||
|
class sdltl{
|
||
|
|
||
|
public:
|
||
|
sdltl(const char *t, int w, int h);
|
||
|
~sdltl();
|
||
|
SDL_Window *window();
|
||
|
SDL_Surface *screen();
|
||
|
bool status();
|
||
|
void setBackground(int r, int g, int b);
|
||
|
bool setImage(const char *url);
|
||
|
void waitEvent(SDL_EventType t, void(*handler)(SDL_Event*) );
|
||
|
void update();
|
||
|
|
||
|
void manageFps(const int fps=0);
|
||
|
|
||
|
private:
|
||
|
// gestion FPS
|
||
|
Uint32 _lasttick;
|
||
|
Uint32 _fpstime;
|
||
|
|
||
|
// status de l'initialisation
|
||
|
bool _status;
|
||
|
|
||
|
// Elements utiles
|
||
|
SDL_Window *_window;
|
||
|
SDL_Surface *_screen;
|
||
|
|
||
|
};
|
||
|
|
||
|
|
||
|
/* [BODY] Inclusion du corps
|
||
|
=========================================================*/
|
||
|
#include "sdltl.cpp"
|
||
|
|
||
|
|
||
|
#endif
|