openATV enigma2
openATV is an open source SetTopBox Graphical user interface.
sdl.h
Go to the documentation of this file.
1 #ifndef __lib_gdi_sdl_h
2 #define __lib_gdi_sdl_h
3 
4 #include <lib/base/thread.h>
5 #include <lib/gdi/gmaindc.h>
6 
7 #include <SDL2/SDL.h>
8 
9 class gSDLDC: public gMainDC, public eThread, public sigc::trackable
10 {
11 private:
12  SDL_Surface *m_screen;
13  SDL_Window *m_window;
14  SDL_Renderer *m_render;
15  SDL_Texture *m_osd_tex;
16  SDL_Surface *m_osd;
17 
18  void exec(const gOpcode *opcode);
19 
20  gUnmanagedSurface m_surface;
21 
23  void keyEvent(const SDL_Event &event);
24  void pumpEvent(const SDL_Event &event);
25  virtual void thread();
26 
27  enum event {
28  EV_SET_VIDEO_MODE,
29  EV_FLIP,
30  EV_QUIT,
31  };
32 
33  void pushEvent(enum event code, void *data1 = 0, void *data2 = 0);
34  void evSetVideoMode(unsigned long xres, unsigned long yres);
35  void evFlip();
36 
37 public:
38  void setResolution(int xres, int yres, int bpp = 32);
39  gSDLDC();
40  virtual ~gSDLDC();
41  int islocked() const { return 0; }
42 };
43 
44 #endif
Definition: thread.h:27
Definition: gmaindc.h:10
Definition: sdl.h:10
gSDLDC()
Definition: sdl.cpp:10
virtual ~gSDLDC()
Definition: sdl.cpp:29
void setResolution(int xres, int yres, int bpp=32)
Definition: sdl.cpp:86
int islocked() const
Definition: sdl.h:41
Definition: grc.h:31
Definition: gpixmap.h:163