2 * Copyright (C) 2010-2013 Team XBMC
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
23 #ifndef WINDOW_SYSTEM_IOSEGL_H
24 #define WINDOW_SYSTEM_IOSEGL_H
26 #if defined(TARGET_DARWIN_IOS)
27 #include "windowing/WinSystem.h"
28 #include "rendering/gles/RenderSystemGLES.h"
29 #include "utils/GlobalsHandling.h"
31 class CWinSystemIOS : public CWinSystemBase, public CRenderSystemGLES
35 virtual ~CWinSystemIOS();
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();
45 virtual void ShowOSMouse(bool show);
46 virtual bool HasCursor();
48 virtual void NotifyAppActiveChange(bool bActivated);
50 virtual bool Minimize();
51 virtual bool Restore() ;
53 virtual bool Show(bool raise = true);
55 virtual bool IsExtSupported(const char* extension);
57 virtual bool BeginRender();
58 virtual bool EndRender();
59 virtual int GetNumScreens();
61 void InitDisplayLink(void);
62 void DeinitDisplayLink(void);
63 double GetDisplayLinkFPS(void);
66 virtual bool PresentRenderImpl(const CDirtyRegionList &dirty);
67 virtual void SetVSyncImpl(bool enable);
69 void *m_glView; // EAGLView opaque
70 void *m_WorkingContext; // shared EAGLContext opaque
71 bool m_bWasFullScreenBeforeMinimize;
76 bool GetScreenResolution(int* w, int* h, double* fps, int screenIdx);
77 void FillInVideoModes();
78 bool SwitchToVideoMode(int width, int height, double refreshrate, int screenIdx);
81 XBMC_GLOBAL_REF(CWinSystemIOS,g_Windowing);
82 #define g_Windowing XBMC_GLOBAL_USE(CWinSystemIOS)
86 #endif // WINDOW_SYSTEM_IOSEGL_H