-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSDL_Screen.h
51 lines (35 loc) · 862 Bytes
/
SDL_Screen.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
//
// Created by Cry on 2018-12-20.
//
#ifndef APPREMOTE_SDL_SCREEN_H
#define APPREMOTE_SDL_SCREEN_H
#include "SDL2/SDL_render.h"
#include "SDL2/SDL_video.h"
#include <SDL2/SDL.h>
#define EVENT_NEW_FRAME (SDL_USEREVENT + 1)
class SDL_Screen {
public:
char *name;
SDL_Window *sdl_window;
SDL_Texture *sdl_texture;
int screen_w;
int screen_h;
SDL_Renderer *sdl_renderer;
SDL_Screen(char *name, int screen_w, int screen_h);
~SDL_Screen();
/**
* 进行初始化
* @return
*/
SDL_bool init();
void destroy();
void uploadTexture(const Uint8 *Yplane, int Ypitch,
const Uint8 *Uplane, int Upitch,
const Uint8 *Vplane, int Vpitch);
void push_frame_event();
};
struct Size {
int width;
int height;
};
#endif //APPREMOTE_SDL_SCREEN_H