diff options
Diffstat (limited to 'Source/Plugins/Plugin_VideoOGL')
| -rw-r--r-- | Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp | 21 | ||||
| -rw-r--r-- | Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h | 12 | ||||
| -rw-r--r-- | Source/Plugins/Plugin_VideoOGL/Src/SConscript | 9 | ||||
| -rw-r--r-- | Source/Plugins/Plugin_VideoOGL/Src/cocoaGL.h | 29 | ||||
| -rwxr-xr-x | Source/Plugins/Plugin_VideoOGL/Src/cocoaGL.m | 149 |
5 files changed, 2 insertions, 218 deletions
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp index 9c9ae2c5cd..9a714eeed5 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp @@ -55,8 +55,6 @@ void OpenGL_SwapBuffers() { #if defined(USE_WX) && USE_WX GLWin.glCanvas->SwapBuffers(); -#elif defined(HAVE_COCOA) && HAVE_COCOA - cocoaGLSwap(GLWin.cocoaCtx,GLWin.cocoaWin); #elif defined(_WIN32) SwapBuffers(hDC); #elif defined(HAVE_X11) && HAVE_X11 @@ -78,8 +76,6 @@ void OpenGL_SetWindowText(const char *text) { #if defined(USE_WX) && USE_WX // GLWin.frame->SetTitle(wxString::FromAscii(text)); -#elif defined(HAVE_COCOA) && HAVE_COCOA - cocoaGLSetTitle(GLWin.cocoaWin, text); #elif defined(_WIN32) // TODO convert text to unicode and change SetWindowTextA to SetWindowText SetWindowTextA(EmuWindow::GetWnd(), text); @@ -268,12 +264,6 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight GLWin.glCanvas->SetCurrent(*GLWin.glCtxt); -#elif defined(HAVE_COCOA) && HAVE_COCOA - GLWin.width = s_backbuffer_width; - GLWin.height = s_backbuffer_height; - GLWin.cocoaWin = cocoaGLCreateWindow(GLWin.width, GLWin.height); - GLWin.cocoaCtx = cocoaGLInit(g_Config.iMultisampleMode); - #elif defined(_WIN32) g_VideoInitialize.pWindowHandle = (void*)EmuWindow::Create((HWND)g_VideoInitialize.pWindowHandle, g_hInstance, _T("Please wait...")); if (g_VideoInitialize.pWindowHandle == NULL) @@ -415,8 +405,6 @@ bool OpenGL_MakeCurrent() // connect the glx-context to the window #if defined(USE_WX) && USE_WX GLWin.glCanvas->SetCurrent(*GLWin.glCtxt); -#elif defined(HAVE_COCOA) && HAVE_COCOA - cocoaGLMakeCurrent(GLWin.cocoaCtx,GLWin.cocoaWin); #elif defined(_WIN32) return wglMakeCurrent(hDC,hRC); #elif defined(HAVE_X11) && HAVE_X11 @@ -437,11 +425,6 @@ void OpenGL_Update() // TODO fill in -#elif defined(HAVE_COCOA) && HAVE_COCOA - RECT rcWindow = {0}; - rcWindow.right = GLWin.width; - rcWindow.bottom = GLWin.height; - #elif defined(_WIN32) RECT rcWindow; if (!EmuWindow::GetParentWnd()) @@ -481,10 +464,6 @@ void OpenGL_Shutdown() { #if defined(USE_WX) && USE_WX delete GLWin.glCanvas; -#elif defined(HAVE_COCOA) && HAVE_COCOA - cocoaGLDeleteWindow(GLWin.cocoaWin); - 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 9c20a1af96..12c53fe8e2 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h @@ -48,10 +48,6 @@ #elif defined(USE_SDL) && USE_SDL #include <GL/glew.h> #include <SDL.h> - -#elif defined(HAVE_COCOA) && HAVE_COCOA -#include <GL/glew.h> -#include "cocoaGL.h" #endif // end USE_WX #if defined(__APPLE__) @@ -76,10 +72,7 @@ typedef struct { int screen; -#if defined(HAVE_COCOA) && HAVE_COCOA - NSWindow *cocoaWin; - NSOpenGLContext *cocoaCtx; -#elif defined(HAVE_X11) && HAVE_X11 +#if defined(HAVE_X11) && HAVE_X11 Window win; Window parent; Display *dpy; @@ -87,8 +80,7 @@ typedef struct { GLXContext ctx; XSetWindowAttributes attr; Common::Thread *xEventThread; -#endif // X11 -#if defined(USE_WX) && USE_WX +#elif defined(USE_WX) && USE_WX wxGLCanvas *glCanvas; wxPanel *panel; wxGLContext *glCtxt; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/SConscript b/Source/Plugins/Plugin_VideoOGL/Src/SConscript index 4793e4b994..2724a150d2 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/SConscript +++ b/Source/Plugins/Plugin_VideoOGL/Src/SConscript @@ -25,8 +25,6 @@ files = [ 'PostProcessing.cpp', 'FramebufferManager.cpp', ] -compileFlags = [ - ] linkFlags = [ ] libs = [ @@ -48,12 +46,6 @@ if gfxenv['HAVE_WX']: 'Debugger/Debugger.cpp', ] -if gfxenv['HAVE_COCOA']: - files += [ 'cocoaGL.m' ] - compileFlags += [ - '-x', - 'objective-c++', - ] if sys.platform == 'win32': files += [ 'OS/Win32.cpp' ] @@ -105,7 +97,6 @@ if gfxenv['USE_WX'] and not gfxenv['HAVE_WX']: print "Must have wx to use wxgl" Return() gfxenv.Append( - CXXFLAGS = compileFlags, LINKFLAGS = linkFlags, ) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/cocoaGL.h b/Source/Plugins/Plugin_VideoOGL/Src/cocoaGL.h deleted file mode 100644 index cdd2a70650..0000000000 --- a/Source/Plugins/Plugin_VideoOGL/Src/cocoaGL.h +++ /dev/null @@ -1,29 +0,0 @@ -#import <Cocoa/Cocoa.h> -#import <OpenGL/CGLRenderers.h> - -#ifdef __cplusplus -extern "C" -{ -#endif - - -void cocoaGLCreateApp(); - -NSWindow *cocoaGLCreateWindow(int w,int h); - -void cocoaGLSetTitle(NSWindow *win, const char *title); - -void cocoaGLMakeCurrent(NSOpenGLContext *ctx, NSWindow *win); - -NSOpenGLContext* cocoaGLInit(int mode); - -void cocoaGLDelete(NSOpenGLContext *ctx); - -void cocoaGLDeleteWindow(NSWindow *window); - -void cocoaGLSwap(NSOpenGLContext *ctx,NSWindow *window); - -#ifdef __cplusplus -} -#endif - diff --git a/Source/Plugins/Plugin_VideoOGL/Src/cocoaGL.m b/Source/Plugins/Plugin_VideoOGL/Src/cocoaGL.m deleted file mode 100755 index 6a821635e2..0000000000 --- a/Source/Plugins/Plugin_VideoOGL/Src/cocoaGL.m +++ /dev/null @@ -1,149 +0,0 @@ -#import "cocoaGL.h" - -NSWindow *cocoaGLCreateWindow(int w,int h) -{ - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSWindow *window; - window = [[NSWindow alloc] initWithContentRect:NSMakeRect(50,50,w,h) - styleMask:NSTitledWindowMask | NSResizableWindowMask - backing:NSBackingStoreBuffered - defer:FALSE]; - [window setReleasedWhenClosed: YES]; - - [window setTitle:@"Dolphin on OSX"]; - //[window makeKeyAndOrderFront: nil]; - - [pool release]; - - return window; -} - -void cocoaGLSetTitle(NSWindow *win, const char *title) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - [win setTitle: [[[NSString alloc] initWithCString: title encoding: NSASCIIStringEncoding] autorelease]]; - - [pool release]; -} - -void cocoaGLMakeCurrent(NSOpenGLContext *ctx, NSWindow *win) -{ - NSAutoreleasePool *pool; - - pool = [[NSAutoreleasePool alloc] init]; - - int value = 0; - [ctx setValues:&value forParameter:NSOpenGLCPSwapInterval]; - - if (ctx) { - [ctx setView:[win contentView]]; - [ctx update]; - [ctx makeCurrentContext]; - } - else - [NSOpenGLContext clearCurrentContext]; - - [pool release]; -} - - - -NSOpenGLContext* cocoaGLInit(int mode) -{ - NSAutoreleasePool *pool; - - NSOpenGLPixelFormatAttribute attr[32]; - NSOpenGLPixelFormat *fmt; - NSOpenGLContext *context; - int i = 0; - - pool = [[NSAutoreleasePool alloc] init]; - - attr[i++] = NSOpenGLPFADepthSize; - attr[i++] = 24; - attr[i++] = NSOpenGLPFADoubleBuffer; - - attr[i++] = NSOpenGLPFASampleBuffers; - attr[i++] = mode; - attr[i++] = NSOpenGLPFASamples; - attr[i++] = 1; - - attr[i++] = NSOpenGLPFANoRecovery; -#ifdef GL_VERSION_1_3 - -#else -#ifdef GL_VERSION_1_2 -#warning "your card only supports ogl 1.2, dolphin will use software renderer" - //if opengl < 1.3 uncomment this twoo lines to use software renderer - attr[i++] = NSOpenGLPFARendererID; - attr[i++] = kCGLRendererGenericFloatID; -#endif -#endif - attr[i++] = NSOpenGLPFAScreenMask; - attr[i++] = CGDisplayIDToOpenGLDisplayMask(CGMainDisplayID()); - - attr[i] = 0; - - fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attr]; - if (fmt == nil) { - printf("failed to create pixel format\n"); - [pool release]; - return NULL; - } - - context = [[NSOpenGLContext alloc] initWithFormat:fmt shareContext:nil]; - - [fmt release]; - - if (context == nil) { - printf("failed to create context\n"); - [pool release]; - return NULL; - } - - [pool release]; - - return context; - -} - -void cocoaGLDelete(NSOpenGLContext *ctx) -{ - NSAutoreleasePool *pool; - - pool = [[NSAutoreleasePool alloc] init]; - - [ctx clearDrawable]; - [ctx release]; - - [pool release]; - -} -void cocoaGLDeleteWindow(NSWindow *window) -{ - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - [window close]; - [pool release]; - - return; -} - -void cocoaGLSwap(NSOpenGLContext *ctx,NSWindow *window) -{ - NSAutoreleasePool *pool; - - pool = [[NSAutoreleasePool alloc] init]; - [window makeKeyAndOrderFront: nil]; - - ctx = [NSOpenGLContext currentContext]; - if (ctx != nil) - [ctx flushBuffer]; - else - printf("bad cocoa gl ctx\n"); - - [pool release]; -} |
