OSX_Platform.h
Go to the documentation of this file.
00001 
00002 #include "../Platform/Platform.h"
00003 #include "../Render/Render_GL_Device.h"
00004 
00005 namespace OVR { namespace Platform { namespace OSX {
00006 
00007 class PlatformCore : public Platform::PlatformCore
00008 {
00009 public:
00010     void*        Win;
00011     void*        View;
00012     void*        NsApp;
00013     bool         Quit;
00014     int          ExitCode;
00015     int          Width, Height;
00016     MouseMode    MMode;
00017     
00018     void RunIdle();
00019 
00020 public:
00021     PlatformCore(Application* app, void* nsapp);
00022     ~PlatformCore();
00023 
00024     bool      SetupWindow(int w, int h);
00025     void      Exit(int exitcode);
00026 
00027     RenderDevice* SetupGraphics(const SetupGraphicsDeviceSet& setupGraphicsDesc,
00028                                 const char* gtype, const Render::RendererParams& rp);
00029 
00030     void      SetMouseMode(MouseMode mm);
00031     void      GetWindowSize(int* w, int* h) const;
00032 
00033     void      SetWindowTitle(const char*title);
00034 
00035     void      ShowWindow(bool show);
00036     void      DestroyWindow();
00037     bool      SetFullscreen(const Render::RendererParams& rp, int fullscreen);
00038     int       GetDisplayCount();
00039     Render::DisplayId GetDisplay(int screen);
00040 
00041     String    GetContentDirectory() const;
00042 };
00043 
00044 }}
00045 namespace Render { namespace GL { namespace OSX {
00046         
00047 class RenderDevice : public Render::GL::RenderDevice
00048 {
00049 public:
00050     void* Context;
00051 
00052     RenderDevice(const Render::RendererParams& p, void* context)
00053     : GL::RenderDevice(p), Context(context) {}
00054             
00055     virtual void Shutdown();
00056     virtual void Present();
00057 
00058     virtual bool SetFullscreen(DisplayMode fullscreen);
00059     
00060     // oswnd = X11::PlatformCore*
00061     static Render::RenderDevice* CreateDevice(const RendererParams& rp, void* oswnd);
00062 };
00063         
00064 }}}}
00065 
00066 
00067 // OVR_PLATFORM_APP_ARGS specifies the Application class to use for startup,
00068 // providing it with startup arguments.
00069 #define OVR_PLATFORM_APP_ARGS(AppClass, args)                                            \
00070 OVR::Platform::Application* OVR::Platform::Application::CreateApplication()          \
00071 { OVR::System::Init(OVR::Log::ConfigureDefaultLog(OVR::LogMask_All));                \
00072 return new AppClass args; }                                                        \
00073 void OVR::Platform::Application::DestroyApplication(OVR::Platform::Application* app) \
00074 { OVR::Platform::PlatformCore* platform = app->pPlatform;                            \
00075 delete app; delete platform; OVR::System::Destroy(); };
00076 
00077 // OVR_PLATFORM_APP_ARGS specifies the Application startup class with no args.
00078 #define OVR_PLATFORM_APP(AppClass) OVR_PLATFORM_APP_ARGS(AppClass, ())
00079 
00080 


oculus_sdk
Author(s):
autogenerated on Mon Oct 6 2014 03:01:18