summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authortmator <tmator@gmail.com>2008-10-27 20:29:32 +0000
committertmator <tmator@gmail.com>2008-10-27 20:29:32 +0000
commita7be7689c162dc7c1cb79a73c0ec094193b8a19a (patch)
tree52c310580f0f783281d0f0f2f9a4ae30e42456db /Source
parent62b49ea2d63d67b0336da3d8bc01db1b119d691a (diff)
add cocoa in ogl plugin
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@976 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source')
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp17
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h13
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/SConscript5
-rw-r--r--Source/Plugins/Plugin_Wiimote_Test/Src/SConscript20
-rw-r--r--Source/Plugins/Plugin_Wiimote_Test/Src/Wiimote.cpp4
5 files changed, 43 insertions, 16 deletions
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 <GL/glxew.h>
#else
+#undef BOOL
#include <GL/glew.h>
+#include "cocoaGL.h"
#endif
-#if defined(__APPLE__)
+#if defined(__APPLE__)
#include <OpenGL/gl.h>
#else
@@ -88,21 +90,24 @@ inline unsigned long timeGetTime()
#undef I_NEED_OS2_H
#undef BOOL
+#if !defined(__APPLE__)
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <X11/extensions/xf86vmode.h>
//#include <gtk/gtk.h>
+#endif
#include <sys/stat.h>
#include <sys/types.h>
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 <wx/aboutdlg.h>
+#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)