GL Studio C++ Runtime API
embedded_display_frame.h
Go to the documentation of this file.
1 /*! \file
2  \brief disti::eglDisplayFrame class. The class for creating standalone executables for EGL.
3 
4  \par Copyright Information
5 
6  Copyright (c) 2017 by The DiSTI Corporation.<br>
7  11301 Corporate Blvd., Suite 100<br>
8  Orlando, Florida 32817<br>
9  USA<br>
10  <br>
11  All rights reserved.<br>
12 
13  This Software contains proprietary trade secrets of DiSTI and may not be
14  reproduced, in whole or part, in any form, or by any means of electronic,
15  mechanical, or otherwise, without the written permission of DiSTI. Said
16  permission may be derived through the purchase of applicable DiSTI product
17  licenses which detail the distribution rights of this content and any
18  Derivative Works based on this or other copyrighted DiSTI Software.
19 
20  NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21  AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22  PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23  AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24  IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25  PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26 
27  LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28  IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29  INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30  DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31  INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32  INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33  OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34  EXCEED FIVE DOLLARS (US$5.00).
35 
36  The aforementioned terms and restrictions are governed by the laws of the
37  State of Florida and the United States of America.
38 
39  */
40 #ifndef EMBEDDED_DISPLAY_H
41 #define EMBEDDED_DISPLAY_H
42 
43 #include "events.h"
44 #include "gls_include.h"
45 #include "runtime_display_frame.h"
46 
47 namespace disti
48 {
49 enum FL_Flags
50 {
51  FL_RGB,
52  FL_DOUBLE,
53  FL_DEPTH
54 };
55 
56 /**
57  * Base class for all embedded (openGL ES) display frame classes
58  */
60 {
61 protected:
62  void WindowFlags( int ) {}
63 
64  /** Builds a DisplayEvent for passing to the handle method
65  * \param x X device coordinate
66  * \param y Y device coordinate
67  * \param pressure Touchscreen pressure
68  * \param eventType Touch event type (e.g. MOUSE_UP,MOUSE_DOWN,MOUSE_DRAG
69  */
70  virtual GLS_EXPORT void BuildAndSendEvent( int x, int y, int pressure, unsigned int eventType );
71 
72  /* \see DisplayFrame */
73  virtual GLS_EXPORT EventCompressor<DisplayFrame>* GetEventComporessor() { return &eventCompressor; }
74 
75 public:
76  enum iDeviceOrientation
77  {
78  ORIENTATION_UNKNOWN = 0,
79  ORIENTATION_PORTRAIT = 1,
80  ORIENTATION_PORTRAIT_UPSIDE_DOWN = 2,
81  ORIENTATION_LANDSCAPE_LEFT = 3,
82  ORIENTATION_LANDSCAPE_RIGHT = 4,
83  ORIENTATION_FACE_UP = 5,
84  ORIENTATION_FACE_DOWN = 6
85  };
86 
87  GLS_EXPORT EmbeddedDisplayFrame( const char* name, int width, int height );
88 
89  virtual GLS_EXPORT ~EmbeddedDisplayFrame();
90 
91  /** Used for event compression. Not for general use by users. */
93 
94  /** Removes (hides) the spash screen
95  * Note on iOS the AppDelegate presents the splash screen for us, so this is just a stub
96  */
97  virtual GLS_EXPORT void RemoveSplash()
98  {
99  }
100 
101  /** Creates the spash screen
102  * Note on iOS the AppDelegate presents the splash screen for us, so this is just a stub
103  */
104  virtual GLS_EXPORT void CreateSplash()
105  {
106  }
107 
108  /** Sets up the default Orthographic projection (which supports things like pan and zoom) */
109  virtual GLS_EXPORT void SetProjection( GlsMatrixType& projMatrix, GlsMatrixType& model );
110 
111  /** \see RuntimetDisplayFrame */
112  GLS_EXPORT void Paint( void ) DISTI_METHOD_OVERRIDE;
113 
114  /** Set a flag that UpdateAnimate can test to see if the window needs redrawing.
115  * \deprecated Use Invalidate() from the GlsPainter interface to trigger a redraw. SetRedraw behaves differently on ES and Desktop platforms.
116  */
117  GLS_EXPORT void SetRedraw() DISTI_METHOD_OVERRIDE;
118 
119  /** Redraw the window now.
120  * This actually calls the OpenGL Drawing routines.
121  */
122  virtual GLS_EXPORT void Redraw( void );
123 };
124 
125 } // namespace disti
126 
127 #endif
EventCompressor< DisplayFrame > eventCompressor
Definition: embedded_display_frame.h:92
virtual void Redraw(void)
Definition: display_frame.h:77
virtual void RemoveSplash()
Definition: embedded_display_frame.h:97
virtual void SetProjection(GlsMatrixType &projMatrix, GlsMatrixType &model)
Definition: runtime_display_frame.h:53
A file for all GL Studio files to include.
virtual void CreateSplash()
Definition: embedded_display_frame.h:104
The standard Mouse and keyboard events and event structures.
void Paint(void) override
Definition: embedded_display_frame.h:59
virtual void BuildAndSendEvent(int x, int y, int pressure, unsigned int eventType)
The disti::RuntimeDisplayFrame class, parent class of all DisplayFrames used in runtime code...
Definition: bmpimage.h:46