29 #ifndef __OSXWindow_H__
30 #define __OSXWindow_H__
32 #include <Carbon/Carbon.h>
35 #include <OpenGL/OpenGL.h>
36 #include <OpenGL/CGLTypes.h>
47 void create(
const String& name,
unsigned int width,
unsigned int height,
50 virtual void destroy(
void ) = 0;
52 virtual bool isActive(
void )
const = 0;
54 virtual bool isClosed(
void )
const = 0;
58 virtual void reposition(
int left,
int top ) = 0;
60 virtual void resize(
unsigned int width,
unsigned int height ) = 0;
71 #if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
78 void createCGLFullscreen(
unsigned int width,
unsigned int height,
unsigned int depth,
unsigned int fsaa, CGLContextObj sharedContext);
83 #if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
84 uint32 bitDepthFromDisplayMode(CGDisplayModeRef mode);
88 #define ENABLE_CG_CHECK 0
90 #define CG_CHECK_ERROR(e) \
92 if((CGError)e != kCGErrorSuccess) \
94 CGReleaseAllDisplays(); \
95 OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, String("CG Error: " + StringConverter::toString(e) + + \
96 " Line # " + StringConverter::toString(__LINE__)), __PRETTY_FUNCTION__); \
100 #define CG_CHECK_ERROR(e) {}
104 #define CGL_CHECK_ERROR(e) \
106 if((CGLError)e != kCGLNoError) \
108 CGReleaseAllDisplays(); \
109 OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, String("CGL Error: " + String(CGLErrorString(e)) + \
110 " Line # " + StringConverter::toString(__LINE__)), __PRETTY_FUNCTION__); \
114 #define CGL_CHECK_ERROR(e) {}
virtual bool isHidden() const =0
Indicates whether the window was set to hidden (not displayed)
virtual bool isActive(void) const =0
Overridden - see RenderWindow.
virtual void resize(unsigned int width, unsigned int height)=0
Overridden - see RenderWindow.
virtual void windowMovedOrResized()
Overridden - see RenderTarget.
void destroyCGLFullscreen(void)
Kill full screen mode, and return to default windowed mode.
virtual void copyContentsToMemory(const PixelBox &dst, FrameBuffer buffer)
Overridden - see RenderTarget.
void swapCGLBuffers(void)
Update the full screen context.
Class that encapsulates an GL context.
CGLContextObj mCGLContextObj
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
virtual void reposition(int left, int top)=0
Overridden - see RenderWindow.
virtual void destroy(void)=0
Overridden - see RenderWindow.
virtual void setHidden(bool hidden)=0
Hide (or show) the window.
void create(const String &name, unsigned int width, unsigned int height, bool fullScreen, const NameValuePairList *miscParams)=0
Overridden - see RenderWindow.
Manages the target rendering window.
virtual bool isClosed(void) const =0
Overridden - see RenderWindow.
A primitive describing a volume (3D), image (2D) or line (1D) of pixels in memory.
void createCGLFullscreen(unsigned int width, unsigned int height, unsigned int depth, unsigned int fsaa, CGLContextObj sharedContext)
Switch to full screen mode using CGL.
CFDictionaryRef mOriginalDisplayMode
virtual void swapBuffers()=0
Overridden - see RenderWindow.