-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcsdlplayer.h
More file actions
39 lines (32 loc) · 873 Bytes
/
csdlplayer.h
File metadata and controls
39 lines (32 loc) · 873 Bytes
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
#ifndef CSDLPLAYER_H
#define CSDLPLAYER_H
extern "C"{
#include "SDL2/SDL.h"
}
#include <string>
#define REFRESH_EVENT (SDL_USEREVENT + 1)
class CSDLPlayer
{
public:
CSDLPlayer();
virtual void Play();
protected:
virtual void Init();
virtual void InitSDL();
virtual void InitFrameData() = 0;
virtual void UpdateTexture(const unsigned char* pBuffer, int& iFrameDataPitch);
virtual void GetRenderData(unsigned char*& pBuffer, int& iFrameDataPitch) = 0;
static int RefreshTimer(void *param);
virtual void Run();
protected:
SDL_Texture* m_SDLTexture;
SDL_Renderer* m_SDLRenderer;
SDL_Window* m_Screen;
SDL_Rect m_SDLRect;
int m_WindowW;
int m_WindowH;
int m_PixelW;
int m_PixelH;
Uint32 m_Pixformat;
};
#endif // CSDLPLAYER_H