Changeset 39206 in vbox
- Timestamp:
- Nov 4, 2011 3:16:16 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
Config.kmk (modified) (1 diff)
-
include/VBox/VBoxCocoa.h (modified) (4 diffs)
-
src/VBox/GuestHost/OpenGL/include/GL/glext.h (modified) (1 diff)
-
src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c (modified) (1 diff)
-
src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.h (modified) (3 diffs)
-
src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r39204 r39206 808 808 if "$(VBOX_DARWIN_HOST_VERSION_MAJOR)" == "7" # Lion 809 809 VBOX_WITH_DOCS= 810 # Using the 10.7 SDK triggers some gl.h include issue. Our problem.811 ifeq ($(VBOX_DEF_MACOSX_VERSION_MIN),10.7)812 VBOX_WITH_CROGL=813 endif814 810 endif 815 811 endif -
trunk/include/VBox/VBoxCocoa.h
r31665 r39206 1 1 /** @file 2 *3 2 * VBoxCocoa Helper 4 3 */ 5 4 6 5 /* 7 * Copyright (C) 2009-201 0Oracle Corporation6 * Copyright (C) 2009-2011 Oracle Corporation 8 7 * 9 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 25 24 */ 26 25 27 #ifndef __ VBoxCocoa_h__28 #define __ VBoxCocoa_h__26 #ifndef ___VBox_VBoxCocoa_h 27 #define ___VBox_VBoxCocoa_h 29 28 30 /* Macro which add a typedef of the given Cocoa class in an appropriate form29 /** Macro which add a typedef of the given Cocoa class in an appropriate form 31 30 * for the current context. This means void* in the C/CPP context and 32 31 * NSWhatever* in the ObjC/ObjCPP context. Use … … 35 34 * right type in the Cocoa context. */ 36 35 #ifdef __OBJC__ 37 # define ADD_COCOA_NATIVE_REF(CocoaClass) \38 @class CocoaClass; \39 typedef CocoaClass *Native##CocoaClass##Ref; \40 typedef const CocoaClass *ConstNative##CocoaClass##Ref41 #else /*__OBJC__ */42 # define ADD_COCOA_NATIVE_REF(CocoaClass) \43 typedef void *Native##CocoaClass##Ref; \44 typedef const void *ConstNative##CocoaClass##Ref45 #endif /* __OBJC__ */36 # define ADD_COCOA_NATIVE_REF(CocoaClass) \ 37 @class CocoaClass; \ 38 typedef CocoaClass *Native##CocoaClass##Ref; \ 39 typedef const CocoaClass *ConstNative##CocoaClass##Ref 40 #else /* !__OBJC__ */ 41 # define ADD_COCOA_NATIVE_REF(CocoaClass) \ 42 typedef void *Native##CocoaClass##Ref; \ 43 typedef const void *ConstNative##CocoaClass##Ref 44 #endif /* !__OBJC__ */ 46 45 47 /* Check for OBJC++ */ 46 47 /* 48 * Objective-C++ Helpers. 49 */ 48 50 #if defined(__OBJC__) && defined (__cplusplus) 49 51 50 52 /* Global includes */ 51 # import <Foundation/NSAutoreleasePool.h>53 # import <Foundation/NSAutoreleasePool.h> 52 54 53 /* Helper class for automatic creation & destroying of a cocoa auto release54 pool. */55 /** Helper class for automatic creation & destroying of a cocoa auto release 56 * pool. */ 55 57 class CocoaAutoreleasePool 56 58 { … … 69 71 }; 70 72 71 #endif /* __OBJC__ */73 #endif /* __OBJC__ && __cplusplus */ 72 74 73 #endif /* __VBoxCocoa_h__*/75 #endif /* !___VBox_VBoxCocoa_h */ 74 76 -
trunk/src/VBox/GuestHost/OpenGL/include/GL/glext.h
r20147 r39206 3718 3718 #endif 3719 3719 3720 /* VBox: HACK ALERT! When building the host side against Mac OS X 10.7 headers, 3721 /Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gltypes.h 3722 is included and it typedefs GLhandleARB differently. In 10.6 and earlier, 3723 gl.h was included instead of gltypes.h (new file) avoiding the conflicting 3724 typedef in Headers/glext.h. 3725 3726 Since sizeof the gltypes.h typedef is 64-bit on 64-bit platforms, we're in 3727 trouble if the type is used for anything important. Fortunately, the 3728 conflict only occurs in three files: renderspu_config.c, renderspu_cocoa.c 3729 and renderspu_cocoa_helper.m. */ 3730 #ifdef RT_OS_DARWIN 3731 # ifndef MAC_OS_X_VERSION_MIN_REQUIRED 3732 # error "MAC_OS_X_VERSION_MIN_REQUIRED is not defined" 3733 # endif 3734 # if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 && defined(__gltypes_h_) 3735 # define GLhandleARB VBoxGLhandleARB 3736 # endif 3737 #endif 3738 3720 3739 #ifndef GL_ARB_shader_objects 3721 3740 /* GL types for handling shader object handles and program/shader text */ -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c
r37332 r39206 1 1 /** @file 2 *3 2 * VirtualBox OpenGL Cocoa Window System implementation 4 3 */ -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.h
r37332 r39206 1 /* $Id$ */ 1 2 /** @file 2 *3 3 * VirtualBox OpenGL Cocoa Window System Helper definition 4 4 */ 5 5 6 6 /* 7 * Copyright (C) 2009 Oracle Corporation7 * Copyright (C) 2009-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 16 16 */ 17 17 18 #ifndef __ renderspu_cocoa_helper_h19 #define __ renderspu_cocoa_helper_h18 #ifndef ___renderspu_cocoa_helper_h 19 #define ___renderspu_cocoa_helper_h 20 20 21 #include <iprt/cdefs.h> 21 22 #include <VBox/VBoxCocoa.h> 22 #include <iprt/cdefs.h>23 23 #include <OpenGL/OpenGL.h> 24 24 … … 56 56 RT_C_DECLS_END 57 57 58 #endif /* __renderspu_cocoa_helper_h */58 #endif /* !___renderspu_cocoa_helper_h */ 59 59 -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m
r37706 r39206 1 /* $Id$ */ 1 2 /** @file 2 * 3 * VirtualBox OpenGL Cocoa Window System Helper implementation 3 * VirtualBox OpenGL Cocoa Window System Helper Implementation. 4 4 */ 5 5 6 6 /* 7 * Copyright (C) 2009 Oracle Corporation7 * Copyright (C) 2009-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 27 27 #include <iprt/time.h> 28 28 29 /* 29 /** @page pg_opengl_cocoa OpenGL - Cocoa Window System Helper 30 * 30 31 * How this works: 31 32 * In general it is not so easy like on the other platforms, cause Cocoa … … 74 75 #define FBO 1 /* Disable this to see how the output is without the FBO in the middle of the processing chain. */ 75 76 #if 0 76 # define SHOW_WINDOW_BACKGROUND 1 /* Define this to see the window background even if the window is clipped */77 # define DEBUG_VERBOSE /* Define this to get some debug info about the messages flow. */77 # define SHOW_WINDOW_BACKGROUND 1 /* Define this to see the window background even if the window is clipped */ 78 # define DEBUG_VERBOSE /* Define this to get some debug info about the messages flow. */ 78 79 #endif 79 80 80 81 #ifdef DEBUG_poetzsch 81 # define DEBUG_MSG(text) \82 # define DEBUG_MSG(text) \ 82 83 printf text 83 84 #else 84 # define DEBUG_MSG(text) \85 # define DEBUG_MSG(text) \ 85 86 do {} while (0) 86 87 #endif 87 88 88 89 #ifdef DEBUG_VERBOSE 89 # define DEBUG_MSG_1(text) \90 # define DEBUG_MSG_1(text) \ 90 91 DEBUG_MSG(text) 91 92 #else 92 # define DEBUG_MSG_1(text) \93 # define DEBUG_MSG_1(text) \ 93 94 do {} while (0) 94 95 #endif 95 96 96 97 #ifdef DEBUG_poetzsch 97 # define CHECK_GL_ERROR()\98 # define CHECK_GL_ERROR()\ 98 99 do \ 99 100 { \ … … 123 124 } 124 125 #else 125 # define CHECK_GL_ERROR()\126 # define CHECK_GL_ERROR()\ 126 127 do {} while (0) 127 128 #endif 128 129 129 130 #define GL_SAVE_STATE \ 130 do \131 { \132 glPushAttrib(GL_ALL_ATTRIB_BITS); \133 glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS); \134 glMatrixMode(GL_PROJECTION); \135 glPushMatrix(); \136 glMatrixMode(GL_TEXTURE); \137 glPushMatrix(); \138 glMatrixMode(GL_COLOR); \139 glPushMatrix(); \140 glMatrixMode(GL_MODELVIEW); \141 glPushMatrix(); \142 } \143 while(0);131 do \ 132 { \ 133 glPushAttrib(GL_ALL_ATTRIB_BITS); \ 134 glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS); \ 135 glMatrixMode(GL_PROJECTION); \ 136 glPushMatrix(); \ 137 glMatrixMode(GL_TEXTURE); \ 138 glPushMatrix(); \ 139 glMatrixMode(GL_COLOR); \ 140 glPushMatrix(); \ 141 glMatrixMode(GL_MODELVIEW); \ 142 glPushMatrix(); \ 143 } \ 144 while(0); 144 145 145 146 #define GL_RESTORE_STATE \ 146 do \ 147 { \ 148 glMatrixMode(GL_MODELVIEW); \ 149 glPopMatrix(); \ 150 glMatrixMode(GL_COLOR); \ 151 glPopMatrix(); \ 152 glMatrixMode(GL_TEXTURE); \ 153 glPopMatrix(); \ 154 glMatrixMode(GL_PROJECTION); \ 155 glPopMatrix(); \ 156 glPopClientAttrib(); \ 157 glPopAttrib(); \ 158 } \ 159 while(0); 160 161 /* Custom OpenGL context class. This implementation doesn't allow to set a view 162 * to the context, but save the view for later use. Also it saves a copy of the 147 do \ 148 { \ 149 glMatrixMode(GL_MODELVIEW); \ 150 glPopMatrix(); \ 151 glMatrixMode(GL_COLOR); \ 152 glPopMatrix(); \ 153 glMatrixMode(GL_TEXTURE); \ 154 glPopMatrix(); \ 155 glMatrixMode(GL_PROJECTION); \ 156 glPopMatrix(); \ 157 glPopClientAttrib(); \ 158 glPopAttrib(); \ 159 } \ 160 while(0); 161 162 /** Custom OpenGL context class. 163 * 164 * This implementation doesn't allow to set a view to the 165 * context, but save the view for later use. Also it saves a copy of the 163 166 * pixel format used to create that context for later use. */ 164 167 @interface OverlayOpenGLContext: NSOpenGLContext … … 173 176 @class DockOverlayView; 174 177 175 /* The custom view class. This is the main class of the cocoa OpenGL 176 * implementation. It manages an frame buffer object for the rendering of the 177 * guest applications. The guest applications render in this frame buffer which 178 /** The custom view class. 179 * This is the main class of the cocoa OpenGL implementation. It 180 * manages an frame buffer object for the rendering of the guest 181 * applications. The guest applications render in this frame buffer which 178 182 * is bind to an OpenGL texture. To display the guest content, an secondary 179 183 * shared OpenGL context of the main OpenGL context is created. The secondary … … 203 207 #endif 204 208 205 /* The corresponding dock tile view of this OpenGL view & all helper209 /** The corresponding dock tile view of this OpenGL view & all helper 206 210 * members. */ 207 211 DockOverlayView *m_DockTileView; … … 221 225 NSSize m_Size; 222 226 223 /* This is necessary for clipping on the root window */227 /** This is necessary for clipping on the root window */ 224 228 NSPoint m_RootShift; 225 229 } … … 262 266 @end 263 267 264 /* Helper view. This view is added as a sub view of the parent view to track 265 * main window changes. Whenever the main window is changed (which happens on 266 * fullscreen/seamless entry/exit) the overlay window is informed & can add 267 * them self as a child window again. */ 268 /** Helper view. 269 * 270 * This view is added as a sub view of the parent view to track 271 * main window changes. Whenever the main window is changed 272 * (which happens on fullscreen/seamless entry/exit) the overlay 273 * window is informed & can add them self as a child window 274 * again. */ 268 275 @class OverlayWindow; 269 276 @interface OverlayHelperView: NSView … … 275 282 @end 276 283 277 /* Custom window class. This is the overlay window which contains our custom 278 * NSView. Its a direct child of the Qt Main window. It marks its background 284 /** Custom window class. 285 * 286 * This is the overlay window which contains our custom NSView. 287 * Its a direct child of the Qt Main window. It marks its background 279 288 * transparent & non opaque to make clipping possible. It also disable mouse 280 289 * events and handle frame change events of the parent view. */
Note:
See TracChangeset
for help on using the changeset viewer.

