| GL Studio C++ Runtime API

embedded_display_frame.h
Go to the documentation of this file.
1/*! \file
2 \brief disti::EmbeddedDisplayFrame 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///< Unused, remains for backward compatibility.
50 enum FL_Flags
51{
52 FL_RGB,
53 FL_DOUBLE,
54 FL_DEPTH
55};
56
57/**
58 * Base class for all embedded (openGL ES) display frame classes
59 */
60 class EmbeddedDisplayFrame : public RuntimeDisplayFrame
61{
62 protected:
63 /// Unused in ES, remains for backward compatibility.
64 void WindowFlags( int ) {}
65
66 /** Builds a DisplayEvent for passing to the handle method
67 * \param x X device coordinate
68 * \param y Y device coordinate
69 * \param pressure Touchscreen pressure
70 * \param eventType Touch event type (e.g. MOUSE_UP,MOUSE_DOWN,MOUSE_DRAG
71 */
72 virtual GLS_EXPORT void BuildAndSendEvent( int x, int y, int pressure, unsigned int eventType );
73
74 virtual GLS_EXPORT EventCompressor<DisplayFrame>* GetEventCompressor() DISTI_METHOD_OVERRIDE { return &eventCompressor; }
75
76 public:
77 ///< Unused, remains for backward compatibility.
78 enum iDeviceOrientation
79 {
80 ORIENTATION_UNKNOWN = 0,
81 ORIENTATION_PORTRAIT = 1,
82 ORIENTATION_PORTRAIT_UPSIDE_DOWN = 2,
83 ORIENTATION_LANDSCAPE_LEFT = 3,
84 ORIENTATION_LANDSCAPE_RIGHT = 4,
85 ORIENTATION_FACE_UP = 5,
86 ORIENTATION_FACE_DOWN = 6
87 };
88
89 /// Create a new EmbeddedDisplayFrame object
90 /// \param name name displayed on the title bar, if supported by the platform
91 /// \param width the width of the window in pixels
92 /// \param height the height of the window in pixels
93 GLS_EXPORT EmbeddedDisplayFrame( const char* name, int width, int height );
94
95 virtual GLS_EXPORT ~EmbeddedDisplayFrame();
96
97 /** Used for event compression. Not for general use by users. */
98 EventCompressor<DisplayFrame> eventCompressor;
99
100 /** Removes (hides) the spash screen
101 * Note on iOS the AppDelegate presents the splash screen for us, so this is just a stub
102 */
103 virtual GLS_EXPORT void RemoveSplash()
104 {
105 }
106
107 /** Creates the spash screen
108 * Note on iOS the AppDelegate presents the splash screen for us, so this is just a stub
109 */
110 virtual GLS_EXPORT void CreateSplash()
111 {
112 }
113
114 /// Sets up the default Orthographic projection (which supports things like pan and zoom).
115 /// \param projMatrix The returned projection matrix.
116 /// \param model The returned modelview matrix.
117 virtual GLS_EXPORT void SetProjection( GlsMatrixType& projMatrix, GlsMatrixType& model );
118
119 GLS_EXPORT void Paint() DISTI_METHOD_OVERRIDE;
120
121 /** Set a flag that UpdateAnimate can test to see if the window needs redrawing.
122 * \deprecated Use Invalidate() from the GlsPainter interface to trigger a redraw. SetRedraw behaves differently on ES and Desktop platforms.
123 */
124 GLS_EXPORT void SetRedraw() DISTI_METHOD_OVERRIDE;
125
126 /** Redraw the window now.
127 * This actually calls the OpenGL Drawing routines.
128 */
129 virtual GLS_EXPORT void Redraw();
130};
131
132} // namespace disti
133
134#endif
disti::EmbeddedDisplayFrame
Definition: embedded_display_frame.h:61
disti::EmbeddedDisplayFrame::SetRedraw
void SetRedraw() override
disti::EmbeddedDisplayFrame::Paint
void Paint() override
disti::EmbeddedDisplayFrame::BuildAndSendEvent
virtual void BuildAndSendEvent(int x, int y, int pressure, unsigned int eventType)
disti::EmbeddedDisplayFrame::WindowFlags
void WindowFlags(int)
Unused in ES, remains for backward compatibility.
Definition: embedded_display_frame.h:64
disti::EmbeddedDisplayFrame::Redraw
virtual void Redraw()
disti::EmbeddedDisplayFrame::SetProjection
virtual void SetProjection(GlsMatrixType &projMatrix, GlsMatrixType &model)
disti::EmbeddedDisplayFrame::iDeviceOrientation
iDeviceOrientation
< Unused, remains for backward compatibility.
Definition: embedded_display_frame.h:79
disti::EmbeddedDisplayFrame::CreateSplash
virtual void CreateSplash()
Definition: embedded_display_frame.h:110
disti::EmbeddedDisplayFrame::EmbeddedDisplayFrame
EmbeddedDisplayFrame(const char *name, int width, int height)
disti::EmbeddedDisplayFrame::GetEventCompressor
virtual EventCompressor< DisplayFrame > * GetEventCompressor() override
Definition: embedded_display_frame.h:74
disti::EmbeddedDisplayFrame::RemoveSplash
virtual void RemoveSplash()
Definition: embedded_display_frame.h:103
disti::EmbeddedDisplayFrame::eventCompressor
EventCompressor< DisplayFrame > eventCompressor
Definition: embedded_display_frame.h:98
disti::EventCompressor
Definition: events.h:662
disti::GlsMatrixAffine< double >
disti::RuntimeDisplayFrame
Definition: runtime_display_frame.h:55
events.h
The standard Mouse and keyboard events and event structures.
DISTI_METHOD_OVERRIDE
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:222
gls_include.h
A file for all GL Studio files to include.
GLS_EXPORT
#define GLS_EXPORT
Macro denoting which functions should be visible from the runtime library.
Definition: gls_include.h:52
disti
Definition: bmpimage.h:47
disti::FL_Flags
FL_Flags
< Unused, remains for backward compatibility.
Definition: embedded_display_frame.h:51
runtime_display_frame.h
The disti::RuntimeDisplayFrame class, parent class of all DisplayFrames used in runtime code.