[5] | 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-2005 The OGRE Team |
---|
| 8 | Also see acknowledgements in Readme.html |
---|
| 9 | |
---|
| 10 | This program is free software; you can redistribute it and/or modify it under |
---|
| 11 | the terms of the GNU Lesser General Public License as published by the Free Software |
---|
| 12 | Foundation; either version 2 of the License, or (at your option) any later |
---|
| 13 | version. |
---|
| 14 | |
---|
| 15 | This program is distributed in the hope that it will be useful, but WITHOUT |
---|
| 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
---|
| 17 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
---|
| 18 | |
---|
| 19 | You should have received a copy of the GNU Lesser General Public License along with |
---|
| 20 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
---|
| 21 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to |
---|
| 22 | http://www.gnu.org/copyleft/lesser.txt. |
---|
| 23 | ----------------------------------------------------------------------------- |
---|
| 24 | */ |
---|
| 25 | |
---|
| 26 | #ifndef __OSXCocoaWindow_H__ |
---|
| 27 | #define __OSXCocoaWindow_H__ |
---|
| 28 | |
---|
| 29 | #include "OgreOSXWindow.h" |
---|
| 30 | #include "OgreOSXCocoaContext.h" |
---|
| 31 | |
---|
| 32 | #include <Cocoa/Cocoa.h> |
---|
| 33 | #include "OgreOSXCocoaView.h" |
---|
| 34 | |
---|
| 35 | namespace Ogre { |
---|
| 36 | class OSXCocoaWindow : public OSXWindow |
---|
| 37 | { |
---|
| 38 | private: |
---|
| 39 | NSWindow *mWindow; |
---|
| 40 | OgreView *mView; |
---|
| 41 | NSOpenGLContext *glContext; |
---|
| 42 | |
---|
| 43 | bool mActive; |
---|
| 44 | bool mClosed; |
---|
| 45 | bool mHasResized; |
---|
| 46 | |
---|
| 47 | // Process pending events |
---|
| 48 | void processEvents(void); |
---|
| 49 | public: |
---|
| 50 | OSXCocoaWindow(); |
---|
| 51 | ~OSXCocoaWindow(); |
---|
| 52 | |
---|
| 53 | OgreView* ogreView() const { return mView; }; |
---|
| 54 | NSOpenGLContext* nsopenGLContext() const { return glContext; }; |
---|
| 55 | void createWithView(OgreView *view); |
---|
| 56 | |
---|
| 57 | void create(const String& name, unsigned int width, unsigned int height, |
---|
| 58 | bool fullScreen, const NameValuePairList *miscParams); |
---|
| 59 | /** Overridden - see RenderWindow */ |
---|
| 60 | void destroy(void); |
---|
| 61 | /** Overridden - see RenderWindow */ |
---|
| 62 | bool isActive(void) const; |
---|
| 63 | /** Overridden - see RenderWindow */ |
---|
| 64 | bool isClosed(void) const; |
---|
| 65 | /** Overridden - see RenderWindow */ |
---|
| 66 | void reposition(int left, int top); |
---|
| 67 | /** Overridden - see RenderWindow */ |
---|
| 68 | void resize(unsigned int width, unsigned int height); |
---|
| 69 | /** Overridden - see RenderWindow */ |
---|
| 70 | void swapBuffers(bool waitForVSync); |
---|
| 71 | /** Overridden - see RenderWindow */ |
---|
| 72 | void windowMovedOrResized(); |
---|
| 73 | |
---|
| 74 | bool requiresTextureFlipping() const { return false; } |
---|
| 75 | void getCustomAttribute( const String& name, void* pData ); |
---|
| 76 | }; |
---|
| 77 | } |
---|
| 78 | |
---|
| 79 | #endif |
---|
| 80 | |
---|