Revision: 37861
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37861
Author:   blendix
Date:     2011-06-27 13:57:27 +0000 (Mon, 27 Jun 2011)
Log Message:
-----------
Fix part of #26850: Cocoa OS X game player was not working, two issues:

* Unlike blender, the game player draws only on windows update callbacks,
  and those wer not implemented.
* Going fullscreen for player was not implemented correct, it expected an
  existing window but actually it should create one.

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm
    trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.h
    trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm
    trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.h
    trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm

Modified: trunk/blender/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm      
2011-06-27 13:18:08 UTC (rev 37860)
+++ trunk/blender/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm      
2011-06-27 13:57:27 UTC (rev 37861)
@@ -164,5 +164,5 @@
 
        //CGDisplayErr err = ::CGDisplaySwitchToMode(m_displayIDs[display], 
displayModeValues);
         
-       return /*err == CGDisplayNoErr ? GHOST_kSuccess :*/ GHOST_kFailure;
+       return /*err == CGDisplayNoErr ?*/ GHOST_kSuccess /*: GHOST_kFailure*/;
 }

Modified: trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.h
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.h       2011-06-27 
13:18:08 UTC (rev 37860)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.h       2011-06-27 
13:57:27 UTC (rev 37861)
@@ -119,14 +119,6 @@
                const GHOST_TEmbedderWindowID parentWindow = 0 
        );
        
-       virtual GHOST_TSuccess beginFullScreen(
-               const GHOST_DisplaySetting& setting, 
-               GHOST_IWindow** window,
-               const bool stereoVisual
-       );
-       
-       virtual GHOST_TSuccess endFullScreen( void );
-       
        
/***************************************************************************************
         ** Event management functionality
         
***************************************************************************************/

Modified: trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm      2011-06-27 
13:18:08 UTC (rev 37860)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm      2011-06-27 
13:57:27 UTC (rev 37861)
@@ -773,26 +773,6 @@
     return window;
 }
 
-GHOST_TSuccess GHOST_SystemCocoa::beginFullScreen(const GHOST_DisplaySetting& 
setting, GHOST_IWindow** window, const bool stereoVisual)
-{      
-       GHOST_IWindow* currentWindow = m_windowManager->getActiveWindow();
-       *window = currentWindow;
-       
-       if(!currentWindow) return GHOST_kFailure;
-       
-       return currentWindow->setState(GHOST_kWindowStateFullScreen);
-}
-
-GHOST_TSuccess GHOST_SystemCocoa::endFullScreen(void)
-{      
-       GHOST_IWindow* currentWindow = m_windowManager->getActiveWindow();
-       if(!currentWindow) return GHOST_kFailure;
-       
-       return currentWindow->setState(GHOST_kWindowStateNormal);
-}
-
-
-       
 /**
  * @note : returns coordinates in Cocoa screen coordinates
  */

Modified: trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.h
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.h       2011-06-27 
13:18:08 UTC (rev 37860)
+++ trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.h       2011-06-27 
13:57:27 UTC (rev 37861)
@@ -42,6 +42,7 @@
 #include "STR_String.h"
 
 @class CocoaWindow;
+@class CocoaOpenGLView;
 
 class GHOST_SystemCocoa;
 
@@ -309,7 +310,7 @@
     CocoaWindow *m_window;
        
        /** The openGL view */
-       NSOpenGLView *m_openGLView; 
+       CocoaOpenGLView *m_openGLView; 
     
        /** The opgnGL drawing context */
        NSOpenGLContext *m_openGLContext;

Modified: trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm      2011-06-27 
13:18:08 UTC (rev 37860)
+++ trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm      2011-06-27 
13:57:27 UTC (rev 37861)
@@ -241,10 +241,19 @@
 //We need to subclass it in order to give Cocoa the feeling key events are 
trapped
 @interface CocoaOpenGLView : NSOpenGLView
 {
+       GHOST_SystemCocoa *systemCocoa;
+       GHOST_WindowCocoa *associatedWindow;
 }
+- (void)setSystemAndWindowCocoa:(GHOST_SystemCocoa *)sysCocoa 
windowCocoa:(GHOST_WindowCocoa *)winCocoa;
 @end
 @implementation CocoaOpenGLView
 
+- (void)setSystemAndWindowCocoa:(GHOST_SystemCocoa *)sysCocoa 
windowCocoa:(GHOST_WindowCocoa *)winCocoa
+{
+       systemCocoa = sysCocoa;
+       associatedWindow = winCocoa;
+}
+
 - (BOOL)acceptsFirstResponder
 {
     return YES;
@@ -294,6 +303,7 @@
     else
     {
         [super drawRect:rect];
+        systemCocoa->handleWindowEvent(GHOST_kEventWindowUpdate, 
associatedWindow);
     }
 }
 
@@ -424,6 +434,8 @@
        //Creates the OpenGL View inside the window
        m_openGLView = [[CocoaOpenGLView alloc] initWithFrame:rect
                                                                                
                 pixelFormat:pixelFormat];
+
+       [m_openGLView setSystemAndWindowCocoa:systemCocoa windowCocoa:this];
        
        [pixelFormat release];
        

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to