diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp index eaae5ef655..6bd8776571 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp @@ -64,7 +64,7 @@ void OpenGL_SwapBuffers() #if USE_SDL SDL_GL_SwapBuffers(); #elif defined(OSX64) - + cocoaGLSwap(GLWin.cocoaWin,GLWin.cocoaWin); #elif defined(_WIN32) SwapBuffers(hDC); #else // GLX @@ -77,7 +77,7 @@ void OpenGL_SetWindowText(const char *text) #if USE_SDL SDL_WM_SetCaption(text, NULL); #elif defined(OSX64) - + cocoaGLSetTitle(); #elif defined(_WIN32) SetWindowText(EmuWindow::GetWnd(), text); #else // GLX @@ -101,6 +101,7 @@ BOOL Callback_PeekMessages() // proper value to return. return FALSE; #elif defined(OSX64) + //TODO return FALSE; #elif defined(_WIN32) //TODO: peekmessage @@ -210,7 +211,11 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight //setup ogl to use double buffering SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); #elif defined(OSX64) - + cocoaGLCreateApp(); + GLWin.width = nBackbufferWidth; + GLWin.height = nBackbufferHeight; + GLWin.cocoaWin = cocoaGLCreateWindow(GLWin.width, GLWin.height); + GLWin.cocoaCtx = cocoaGLInit(g_Config.iMultisampleMode); #elif defined(_WIN32) // create the window if (!g_Config.renderToMainframe || g_VideoInitialize.pWindowHandle == NULL) @@ -491,7 +496,7 @@ bool OpenGL_MakeCurrent() return false; } #elif defined(OSX64) - + cocoaGLMakeCurrent(GLWin.cocoaWin,GLWin.cocoaCtx); #elif defined(_WIN32) if (!wglMakeCurrent(hDC,hRC)) { MessageBox(NULL,"(5) Can't Activate The GL Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION); @@ -530,6 +535,8 @@ void OpenGL_Update() nBackbufferHeight = surface->h; #elif defined(OSX64) RECT rcWindow; + rcWindow.right = GLWin.width; + rcWindow.bottom = GLWin.height; #elif defined(_WIN32) if (!EmuWindow::GetParentWnd()) return; @@ -666,7 +673,7 @@ void OpenGL_Shutdown() #if USE_SDL SDL_Quit(); #elif defined(OSX64) - + cocoaGLDelete(GLWin.cocoaCtx); #elif defined(_WIN32) if (hRC) // Do We Have A Rendering Context? { diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h index 2c1a84dea1..336697d7ea 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h @@ -37,10 +37,12 @@ #if !defined(OSX64) #include #else +#undef BOOL #include +#include "cocoaGL.h" #endif -#if defined(__APPLE__) +#if defined(__APPLE__) #include #else @@ -88,21 +90,24 @@ inline unsigned long timeGetTime() #undef I_NEED_OS2_H #undef BOOL +#if !defined(__APPLE__) #include #include #include #include //#include +#endif #include #include typedef struct { - Display *dpy; int screen; - Window win; #if defined(OSX64) - + NSWindow *cocoaWin; + NSOpenGLContext *cocoaCtx; #else //linux + Window win; + Display *dpy; GLXContext ctx; XSetWindowAttributes attr; Bool fs; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/SConscript b/Source/Plugins/Plugin_VideoOGL/Src/SConscript index 5fecb68dbe..8dacba06b5 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/SConscript +++ b/Source/Plugins/Plugin_VideoOGL/Src/SConscript @@ -63,7 +63,10 @@ if gfxenv['osx64']: if sys.platform == 'darwin': platform = 'mac' # SDL is currently the only way to get video on Mac OS X. - useSDL = True + if gfxenv['osx64']: + useSDL = False + else: + useSDL = True # TODO: clean it up (use incpath and libpath) # Use libraries from MacPorts. compileFlags.append('-I/opt/local/include') diff --git a/Source/Plugins/Plugin_Wiimote_Test/Src/SConscript b/Source/Plugins/Plugin_Wiimote_Test/Src/SConscript index fc4ef277a8..d3bd9432cc 100644 --- a/Source/Plugins/Plugin_Wiimote_Test/Src/SConscript +++ b/Source/Plugins/Plugin_Wiimote_Test/Src/SConscript @@ -13,9 +13,17 @@ files = [ ] padenv = env.Clone() -padenv.Append( - CXXFLAGS = [ '-fPIC' ], - LIBS = [ 'common' ], - ) -if not env['osx64']: - padenv.SharedLibrary(output, files) + +if padenv['osx64']: + padenv.Append( + CXXFLAGS = [ '-arch', 'x86_64' ], + LINKFLAGS = [ '-arch', 'x86_64' ], + LIBS = [ 'common' ], + ) +else: + padenv.Append( + CXXFLAGS = [ '-fPIC' ], + LIBS = [ 'common' ], + ) + +padenv.SharedLibrary(output, files) diff --git a/Source/Plugins/Plugin_Wiimote_Test/Src/Wiimote.cpp b/Source/Plugins/Plugin_Wiimote_Test/Src/Wiimote.cpp index ec9931d6c6..f86ee73eb5 100644 --- a/Source/Plugins/Plugin_Wiimote_Test/Src/Wiimote.cpp +++ b/Source/Plugins/Plugin_Wiimote_Test/Src/Wiimote.cpp @@ -1,4 +1,6 @@ +#if !defined(OSX64) #include +#endif #include "Common.h" #include "StringUtil.h" @@ -145,11 +147,13 @@ extern "C" void GetDllInfo (PLUGIN_INFO* _PluginInfo) extern "C" void DllAbout(HWND _hParent) { +#if !defined(OSX64) wxAboutDialogInfo info; info.SetName(_T("Wiimote test plugin")); info.AddDeveloper(_T("masken (masken3@gmail.com)")); info.SetDescription(_T("Wiimote test plugin")); wxAboutBox(info); +#endif } extern "C" void DllConfig(HWND _hParent)