OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreEAGL2Window.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 
29 #ifndef __EAGL2Window_H__
30 #define __EAGL2Window_H__
31 
32 #include "OgreRenderWindow.h"
33 
34 #ifdef __OBJC__
35 #import "OgreEAGL2View.h"
37 
38 // Forward declarations
39 @class CAEAGLLayer;
40 
41 // Define the native window type
42 typedef UIWindow *NativeWindowType;
43 
44 #endif
45 
46 namespace Ogre {
47  class EAGL2Support;
48  class EAGLES2Context;
49 
51  {
52  protected:
53  bool mClosed;
54  bool mVisible;
61 
62  // iOS 4 content scaling
65 
68 #ifdef __OBJC__
69  NativeWindowType mWindow;
70  EAGL2View *mView;
71  EAGL2ViewController *mViewController;
72 #endif
73 
74  void switchFullScreen(bool fullscreen) { }
75  void getLeftAndTopFromNativeWindow(int & left, int & top, uint width, uint height);
76  void initNativeCreatedWindow(const NameValuePairList *miscParams);
77  void createNativeWindow(int &left, int &top, uint &width, uint &height, String &title);
78  void reposition(int left, int top);
79  void resize(unsigned int width, unsigned int height);
80  void windowMovedOrResized();
81  virtual void _beginUpdate();
82 
83  public:
84  EAGL2Window(EAGL2Support* glsupport);
85  virtual ~EAGL2Window();
86 
87  void create(const String& name, unsigned int width, unsigned int height,
88  bool fullScreen, const NameValuePairList *miscParams);
89 
90  virtual void setFullscreen(bool fullscreen, uint width, uint height);
91  void destroy(void);
92  bool isClosed(void) const { return mClosed; }
93  bool isVisible(void) const { return mVisible; }
94 
95  void setVisible(bool visible) { mVisible = visible; }
96  void setClosed(bool closed) { mClosed = closed; }
97  void swapBuffers();
98  void copyContentsToMemory(const PixelBox &dst, FrameBuffer buffer);
100 
110  virtual void getCustomAttribute(const String& name, void* pData);
111 
112  bool requiresTextureFlipping() const { return false; }
113  };
114 }
115 
116 #endif
Manages the target rendering window.
bool mIsExternal
Is this using an external window handle?
bool isVisible(void) const
Indicates whether the window is visible (not minimized or obscured)
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
Definition: OgreCommon.h:580
PixelFormat suggestPixelFormat() const
Override since windows don't usually have alpha.
EAGLES2Context * mContext
bool mUsingExternalView
Is this using an external view handle?
4 byte pixel format, 1 byte for red, 1 byte for green, 1 byte for blue, and one byte for alpha ...
bool isClosed(void) const
Indicates whether the window has been closed by the user.
PixelFormat
The pixel format used for images, textures, and render surfaces.
#define _OgrePrivate
Definition: OgrePlatform.h:256
bool mUsingExternalViewController
Is this using an external view controller handle?
EAGL2Support * mGLSupport
void setVisible(bool visible)
Set the visibility state.
void setClosed(bool closed)
_StringBase String
Definition: OgreCommon.h:53
void switchFullScreen(bool fullscreen)
bool requiresTextureFlipping() const
unsigned int uint