[cosmetics] update date in GPL header
[vuplus_xbmc] / xbmc / windowing / X11 / WinSystemX11GLES.h
1 #ifndef WINDOW_SYSTEM_EGL_H
2 #define WINDOW_SYSTEM_EGL_H
3
4 #pragma once
5
6 /*
7  *      Copyright (C) 2005-2013 Team XBMC
8  *      http://www.xbmc.org
9  *
10  *  This Program is free software; you can redistribute it and/or modify
11  *  it under the terms of the GNU General Public License as published by
12  *  the Free Software Foundation; either version 2, or (at your option)
13  *  any later version.
14  *
15  *  This Program is distributed in the hope that it will be useful,
16  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  *  GNU General Public License for more details.
19  *
20  *  You should have received a copy of the GNU General Public License
21  *  along with XBMC; see the file COPYING.  If not, see
22  *  <http://www.gnu.org/licenses/>.
23  *
24  */
25 #include "windowing/WinSystem.h"
26 #include <EGL/egl.h>
27 #include <X11/Xlib.h>
28 #include "rendering/gles/RenderSystemGLES.h"
29 #include "utils/GlobalsHandling.h"
30
31 class CWinSystemX11GLES : public CWinSystemBase, public CRenderSystemGLES
32 {
33 public:
34   CWinSystemX11GLES();
35   virtual ~CWinSystemX11GLES();
36
37   virtual bool InitWindowSystem();
38   virtual bool DestroyWindowSystem();
39   virtual bool CreateNewWindow(const CStdString& name, bool fullScreen, RESOLUTION_INFO& res, PHANDLE_EVENT_FUNC userFunction);
40   virtual bool DestroyWindow();
41   virtual bool ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop);
42   virtual bool SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays);
43   virtual void UpdateResolutions();
44
45   virtual void ShowOSMouse(bool show);
46
47   virtual void NotifyAppActiveChange(bool bActivated);
48
49   virtual bool Minimize();
50   virtual bool Restore() ;
51   virtual bool Hide();
52   virtual bool Show(bool raise = true);
53
54   virtual bool IsExtSupported(const char* extension);
55
56   virtual bool makeOMXCurrent();
57
58   EGLContext GetEGLContext() const;
59   EGLDisplay GetEGLDisplay() const;
60 protected:
61   bool RefreshEGLContext();
62
63   SDL_Surface* m_SDLSurface;
64   EGLDisplay   m_eglDisplay;
65   EGLContext   m_eglContext;
66   EGLContext   m_eglOMXContext;
67   EGLSurface   m_eglSurface;
68   Window       m_eglWindow;
69   Window       m_wmWindow;
70   Display*     m_dpy;
71
72   bool         m_bWasFullScreenBeforeMinimize;
73
74   virtual bool PresentRenderImpl(const CDirtyRegionList &dirty);
75   virtual void SetVSyncImpl(bool enable);
76   
77   CStdString m_eglext;
78
79   int m_iVSyncErrors;
80 };
81
82 XBMC_GLOBAL_REF(CWinSystemX11GLES,g_Windowing);
83 #define g_Windowing XBMC_GLOBAL_USE(CWinSystemX11GLES)
84
85 #endif // WINDOW_SYSTEM_H