summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authornakeee <nakeee@gmail.com>2008-12-18 21:40:50 +0000
committernakeee <nakeee@gmail.com>2008-12-18 21:40:50 +0000
commitfa00041f7708a26a6522be35e4b8f1d765cf3b60 (patch)
tree2953ed0ab8b85c0b16c1bdc34dc14d3baeb52d68 /Source
parent3d9c903a3b97b109a9f2f62d83bf82f4917a4105 (diff)
Fix compile on osx
Added SetTitle support to cocoa git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1588 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source')
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp2
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/GLWindow.h8
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/SDLWindow.h2
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/WXGLWindow.h3
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/cocoaGL.h2
-rwxr-xr-xSource/Plugins/Plugin_VideoOGL/Src/cocoaGL.m7
6 files changed, 15 insertions, 9 deletions
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp
index 979f8bad1d..47e400188f 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp
@@ -72,7 +72,7 @@ void OpenGL_SetWindowText(const char *text)
#if USE_SDL
SDL_WM_SetCaption(text, NULL);
#elif defined(HAVE_COCOA) && HAVE_COCOA
- cocoaGLSetTitle();
+ cocoaGLSetTitle(GLWin.cocoaWin, text);
#elif defined(_WIN32)
SetWindowText(EmuWindow::GetWnd(), text);
#elif defined(USE_WX) && USE_WX
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLWindow.h b/Source/Plugins/Plugin_VideoOGL/Src/GLWindow.h
index 125bee832f..7ad54ebf64 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/GLWindow.h
+++ b/Source/Plugins/Plugin_VideoOGL/Src/GLWindow.h
@@ -6,6 +6,14 @@
#include "Config.h"
#include "pluginspecs_video.h"
+#include <GL/glew.h>
+
+#if defined(__APPLE__)
+#include <OpenGL/gl.h>
+#else
+#include <GL/gl.h>
+#endif
+
class GLWindow {
private:
u32 width, height;
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/SDLWindow.h b/Source/Plugins/Plugin_VideoOGL/Src/SDLWindow.h
index 472d738064..274c1c885b 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/SDLWindow.h
+++ b/Source/Plugins/Plugin_VideoOGL/Src/SDLWindow.h
@@ -2,9 +2,7 @@
#define _SDLWINDOW_H
#include "GLWindow.h"
-#include <GL/glxew.h>
#include <SDL.h>
-#include <GL/gl.h>
class SDLWindow : public GLWindow
{
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/WXGLWindow.h b/Source/Plugins/Plugin_VideoOGL/Src/WXGLWindow.h
index 2a1f6badfe..7a972947db 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/WXGLWindow.h
+++ b/Source/Plugins/Plugin_VideoOGL/Src/WXGLWindow.h
@@ -2,12 +2,9 @@
#define _WXGLWINDOW_H
#include "GLWindow.h"
-#include <GL/glew.h>
#include "wx/wx.h"
#include "wx/glcanvas.h"
-#include <GL/gl.h>
-
class WXGLWindow : public GLWindow
{
private:
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/cocoaGL.h b/Source/Plugins/Plugin_VideoOGL/Src/cocoaGL.h
index 630cdf3c2d..8409de66c9 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/cocoaGL.h
+++ b/Source/Plugins/Plugin_VideoOGL/Src/cocoaGL.h
@@ -11,7 +11,7 @@ void cocoaGLCreateApp();
NSWindow *cocoaGLCreateWindow(int w,int h);
-void cocoaGLSetTitle();
+void cocoaGLSetTitle(NSWindow *win, const char *title);
void cocoaGLMakeCurrent(NSOpenGLContext *ctx, NSWindow *win);
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/cocoaGL.m b/Source/Plugins/Plugin_VideoOGL/Src/cocoaGL.m
index 57047840eb..dcd7896067 100755
--- a/Source/Plugins/Plugin_VideoOGL/Src/cocoaGL.m
+++ b/Source/Plugins/Plugin_VideoOGL/Src/cocoaGL.m
@@ -65,10 +65,13 @@ NSWindow *cocoaGLCreateWindow(int w,int h)
return window;
}
-void cocoaGLSetTitle()
+void cocoaGLSetTitle(NSWindow *win, const char *title)
{
- //todo
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ [win setTitle: [[[NSString alloc] initWithCString: title encoding: NSASCIIStringEncoding] autorelease]];
+ [pool release];
}
void cocoaGLMakeCurrent(NSOpenGLContext *ctx, NSWindow *win)