ASPiK SDK
uiopenglview.h
1 // This file is part of VSTGUI. It is subject to the license terms
2 // in the LICENSE file found in the top-level directory of this
3 // distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
4 
5 #ifndef __uiopenglview__
6 #define __uiopenglview__
7 
8 #include "../../iplatformopenglview.h"
9 
10 #if TARGET_OS_IPHONE
11 #if VSTGUI_OPENGL_SUPPORT
12 
13 #ifdef __OBJC__
14  @class UIView, GLKView, NSRecursiveLock;
15 #else
16  struct GLKView;
17  struct UIView;
18  struct NSRecursiveLock;
19 #endif
20 
21 namespace VSTGUI {
22 
23 //------------------------------------------------------------------------------------
24 class GLKitOpenGLView : public IPlatformOpenGLView
25 {
26 public:
27  GLKitOpenGLView (UIView* parent);
28  ~GLKitOpenGLView ();
29 
30  bool init (IOpenGLView* view, PixelFormat* pixelFormat = nullptr) override;
31  void remove () override;
32 
33  void invalidRect (const CRect& rect) override;
34  void viewSizeChanged (const CRect& visibleSize) override;
35 
36  bool makeContextCurrent () override;
37  bool lockContext () override;
38  bool unlockContext () override;
39 
40  void swapBuffers () override;
41 
42  void doDraw (const CRect& r);
43 
44 //------------------------------------------------------------------------------------
45 protected:
46  UIView* parent;
47  GLKView* platformView;
48  IOpenGLView* view;
49  NSRecursiveLock* lock;
50  PixelFormat pixelFormat;
51 };
52 
53 } // namespace
54 
55 #endif // VSTGUI_OPENGL_SUPPORT
56 #endif // TARGET_OS_IPHONE
57 
58 #endif // __uiopenglview__
Definition: customcontrols.cpp:8