kodi
IOSEAGLView.h
1 /*
2  * Copyright (C) 2010-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #import <OpenGLES/EAGL.h>
10 #import <OpenGLES/ES2/gl.h>
11 #import <UIKit/UIKit.h>
12 
13 // This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass.
14 // The view content is basically an EAGL surface you render your OpenGL scene into.
15 // Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel.
16 @interface IOSEAGLView : UIView
17 {
18 @private
19  EAGLContext *context;
20  // The pixel dimensions of the CAEAGLLayer.
21  GLint framebufferWidth;
22  GLint framebufferHeight;
23  // The OpenGL ES names for the framebuffer and renderbuffer used to render to this view.
24  GLuint defaultFramebuffer, colorRenderbuffer, depthRenderbuffer;
25  // the shader program object
26  GLuint program;
27  //
28  GLfloat rotz;
29 
30  BOOL animating;
31  BOOL xbmcAlive;
32  BOOL readyToRun;
33  BOOL pause;
34  NSConditionLock* animationThreadLock;
35  NSThread* animationThread;
36  UIScreen* __weak currentScreen;
37 
38  BOOL framebufferResizeRequested;
39 }
40 @property (readonly, nonatomic, getter=isAnimating) BOOL animating;
41 @property (readonly, nonatomic, getter=isXBMCAlive) BOOL xbmcAlive;
42 @property (readonly, nonatomic, getter=isReadyToRun) BOOL readyToRun;
43 @property (readonly, nonatomic, getter=isPause) BOOL pause;
44 @property(weak, readonly, getter=getCurrentScreen) UIScreen* currentScreen;
45 @property (readonly, getter=getCurrentEAGLContext) EAGLContext *context;
46 @property BOOL framebufferResizeRequested;
47 
48 - (id)initWithFrame:(CGRect)frame withScreen:(UIScreen *)screen;
49 - (void) pauseAnimation;
50 - (void) resumeAnimation;
51 - (void) startAnimation;
52 - (void) stopAnimation;
53 - (void) setFramebuffer;
54 - (bool) presentFramebuffer;
55 - (void) setScreen:(UIScreen *)screen withFrameBufferResize:(BOOL)resize;
56 - (CGFloat) getScreenScale:(UIScreen *)screen;
57 @end
Definition: IOSEAGLView.h:16