Changeset 39206 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/render
- Timestamp:
- Nov 4, 2011 3:16:16 PM (13 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL/render
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
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.