2 * Copyright (C) 2010-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "rendering/gles/RenderSystemGLES.h"
12 #include "threads/CriticalSection.h"
13 #include "windowing/WinSystem.h"
18 #include <CoreVideo/CVOpenGLESTextureCache.h>
22 struct CADisplayLinkWrapper
;
24 class CWinSystemIOS
: public CWinSystemBase
, public CRenderSystemGLES
28 ~CWinSystemIOS() override
;
30 static void Register();
31 static std::unique_ptr
<CWinSystemBase
> CreateWinSystem();
33 int GetDisplayIndexFromSettings();
34 // Implementation of CWinSystemBase
35 CRenderSystemBase
*GetRenderSystem() override
{ return this; }
36 bool InitWindowSystem() override
;
37 bool DestroyWindowSystem() override
;
38 bool CreateNewWindow(const std::string
& name
, bool fullScreen
, RESOLUTION_INFO
& res
) override
;
39 bool DestroyWindow() override
;
40 bool ResizeWindow(int newWidth
, int newHeight
, int newLeft
, int newTop
) override
;
41 bool SetFullScreen(bool fullScreen
, RESOLUTION_INFO
& res
, bool blankOtherDisplays
) override
;
42 void UpdateResolutions() override
;
43 bool CanDoWindowed() override
{ return false; }
45 void ShowOSMouse(bool show
) override
{}
46 bool HasCursor() override
;
48 void NotifyAppActiveChange(bool bActivated
) override
;
50 bool Minimize() override
;
51 bool Restore() override
;
53 bool Show(bool raise
= true) override
;
55 bool IsExtSupported(const char* extension
) const override
;
57 bool BeginRender() override
;
58 bool EndRender() override
;
60 void Register(IDispResource
*resource
) override
;
61 void Unregister(IDispResource
*resource
) override
;
63 std::unique_ptr
<CVideoSync
> GetVideoSync(void* clock
) override
;
65 std::vector
<std::string
> GetConnectedOutputs() override
;
67 bool InitDisplayLink(CVideoSyncIos
*syncImpl
);
68 void DeinitDisplayLink(void);
69 void OnAppFocusChange(bool focus
);
70 bool IsBackgrounded() const { return m_bIsBackgrounded
; }
71 CVEAGLContext
GetEAGLContextObj();
72 void MoveToTouchscreen();
75 bool MessagePump() override
;
78 void PresentRenderImpl(bool rendered
) override
;
79 void SetVSyncImpl(bool enable
) override
{}
81 void *m_glView
; // EAGLView opaque
82 void *m_WorkingContext
; // shared EAGLContext opaque
83 bool m_bWasFullScreenBeforeMinimize
;
85 CCriticalSection m_resourceSection
;
86 std::vector
<IDispResource
*> m_resources
;
87 bool m_bIsBackgrounded
;
90 bool GetScreenResolution(int* w
, int* h
, double* fps
, int screenIdx
);
91 void FillInVideoModes(int screenIdx
);
92 bool SwitchToVideoMode(int width
, int height
, double refreshrate
);
93 CADisplayLinkWrapper
*m_pDisplayLink
;
94 int m_internalTouchscreenResolutionWidth
= -1;
95 int m_internalTouchscreenResolutionHeight
= -1;