OGRE  1.8
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreOSXCarbonWindow.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-2013 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 __OSXCarbonWindow_H__
30 #define __OSXCarbonWindow_H__
31 
32 // 64-bit Mac OS X doesn't support Carbon UI API
33 #ifndef __LP64__
34 
35 #include "OgreOSXWindow.h"
36 
37 #include "OgreOSXCarbonContext.h"
38 #include "OgreOSXCGLContext.h"
39 
40 namespace Ogre
41 {
42  class OSXCarbonWindow : public OSXWindow
43  {
44  public:
46  virtual ~OSXCarbonWindow();
47 
48  virtual void create( const String& name, unsigned int width, unsigned int height,
49  bool fullScreen, const NameValuePairList *miscParams );
51  virtual void destroy( void );
53  virtual bool isActive( void ) const;
55  virtual bool isClosed( void ) const;
57  bool isHidden(void) const { return mHidden; }
59  void setHidden(bool hidden);
61  void setVSyncEnabled(bool vsync);
63  bool isVSyncEnabled() const;
65  virtual void reposition( int left, int top );
67  virtual void resize( unsigned int width, unsigned int height );
69  virtual void setVisible( bool visible );
71  virtual bool isVisible(void) const;
73  virtual void swapBuffers( bool waitForVSync );
75  virtual void setFullscreen(bool fullScreen, unsigned int width, unsigned int height);
77  virtual void windowMovedOrResized();
78 
79  bool requiresTextureFlipping(void) const { return false; }
80 
81  void windowResized(void);
82  void windowHasResized(void);
83 
84  void getCustomAttribute( const String& name, void* pData );
85 
86  private:
87  void createNewWindow(unsigned int width, unsigned int height, String title);
88  void createWindowFromExternal(HIViewRef viewRef);
89  void createAGLContext(size_t fsaa_samples, int depth);
90 
91  WindowRef mWindow;
92  EventHandlerRef mEventHandlerRef;
93  HIViewRef mView;
94  AGLContext mAGLContext;
95  AGLPixelFormat mAGLPixelFormat;
99  bool mVSync;
100  bool mActive;
101  bool mClosed;
102  bool mHidden;
103  bool mCreated;
106  bool mVisible;
107  };
108 }
109 
110 #endif // __LP64__
111 
112 #endif
virtual void reposition(int left, int top)
Overridden - see RenderWindow.
bool requiresTextureFlipping(void) const
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
Definition: OgreCommon.h:553
void setHidden(bool hidden)
RenderWindow::setHidden
void getCustomAttribute(const String &name, void *pData)
Gets a custom (maybe platform-specific) attribute.
bool isVSyncEnabled() const
RenderWindow::isVSyncEnabled
EventHandlerRef mEventHandlerRef
OSXCGLContext * mCGLContext
virtual bool isVisible(void) const
Overridden - see RenderWindow.
bool isHidden(void) const
RenderWindow::isHidden
void createAGLContext(size_t fsaa_samples, int depth)
void windowHasResized(void)
virtual void create(const String &name, unsigned int width, unsigned int height, bool fullScreen, const NameValuePairList *miscParams)
Overridden - see RenderWindow.
virtual bool isActive(void) const
Overridden - see RenderWindow.
void setVSyncEnabled(bool vsync)
RenderWindow::setVSyncEnabled
AGLPixelFormat mAGLPixelFormat
OSXCarbonContext * mCarbonContext
virtual bool isClosed(void) const
Overridden - see RenderWindow.
virtual void destroy(void)
Overridden - see RenderWindow.
virtual void windowMovedOrResized()
Overridden - see RenderTarget.
void createNewWindow(unsigned int width, unsigned int height, String title)
void createWindowFromExternal(HIViewRef viewRef)
void windowResized(void)
virtual void resize(unsigned int width, unsigned int height)
Overridden - see RenderWindow.
virtual ~OSXCarbonWindow()
virtual void setVisible(bool visible)
Overridden - see RenderWindow.
_StringBase String
virtual void setFullscreen(bool fullScreen, unsigned int width, unsigned int height)
Overridden - see RenderWindow.
virtual void swapBuffers(bool waitForVSync)
Overridden - see RenderWindow.