-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsdl.h
64 lines (53 loc) · 1.03 KB
/
sdl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* vga.h
*
* Created on: Jan 3, 2019
* Author: pedward
*/
#ifndef SDL_H_
#define SDL_H_
#ifdef __GNUC__
#include <SDL2/SDL.h>
#include "image.h"
#include "adapter.h"
class sdl: public adapter
{
protected:
SDL_Window* _window;
SDL_Surface* _screen;
SDL_Renderer* _renderer;
SDL_Surface* _render;
SDL_Texture* _texture;
SDL_Event _event;
unsigned int _sdlscale;
static const adapter::video_mode video_modes[];
static bool SDLonce;
protected:
bool sdlmode(Mode mode);
public:
sdl(void);
~sdl(void);
bool setup(void);
bool setpalette(palette::pal_type pal);
bool setpalette(palette::pal_t *pal, int palette_entries);
bool graphmode(Mode mode);
Mode getmode(void);
bool textmode(void) { return false; }
void cls(void);
void update(void);
void vsync(void) {}
void translate(ptr_t src);
int kbhit(void);
int getch(void);
int getEvents(int ms);
unsigned int getscalewidth() const
{
return _sdlscale*_width;
}
unsigned int getscaleheight() const
{
return _sdlscale*_height;
}
};
#endif
#endif /* SDL_H_ */