VirtualBox

Ignore:
Timestamp:
Nov 4, 2011 3:16:16 PM (13 years ago)
Author:
vboxsync
Message:

Made OpenGL build against the Mac OS X 10.7 SDK. Some cleanups.

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  
    11/** @file
    2  *
    32 * VirtualBox OpenGL Cocoa Window System implementation
    43 */
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.h

    r37332 r39206  
     1/* $Id$ */
    12/** @file
    2  *
    33 * VirtualBox OpenGL Cocoa Window System Helper definition
    44 */
    55
    66/*
    7  * Copyright (C) 2009 Oracle Corporation
     7 * Copyright (C) 2009-2011 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 #ifndef __renderspu_cocoa_helper_h
    19 #define __renderspu_cocoa_helper_h
     18#ifndef ___renderspu_cocoa_helper_h
     19#define ___renderspu_cocoa_helper_h
    2020
     21#include <iprt/cdefs.h>
    2122#include <VBox/VBoxCocoa.h>
    22 #include <iprt/cdefs.h>
    2323#include <OpenGL/OpenGL.h>
    2424
     
    5656RT_C_DECLS_END
    5757
    58 #endif /* __renderspu_cocoa_helper_h */
     58#endif /* !___renderspu_cocoa_helper_h */
    5959
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m

    r37706 r39206  
     1/* $Id$ */
    12/** @file
    2  *
    3  * VirtualBox OpenGL Cocoa Window System Helper implementation
     3 * VirtualBox OpenGL Cocoa Window System Helper Implementation.
    44 */
    55
    66/*
    7  * Copyright (C) 2009 Oracle Corporation
     7 * Copyright (C) 2009-2011 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2727#include <iprt/time.h>
    2828
    29 /*
     29/** @page pg_opengl_cocoa  OpenGL - Cocoa Window System Helper
     30 *
    3031 * How this works:
    3132 * In general it is not so easy like on the other platforms, cause Cocoa
     
    7475#define FBO 1 /* Disable this to see how the output is without the FBO in the middle of the processing chain. */
    7576#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. */
    7879#endif
    7980
    8081#ifdef DEBUG_poetzsch
    81 #define DEBUG_MSG(text) \
     82# define DEBUG_MSG(text) \
    8283    printf text
    8384#else
    84 #define DEBUG_MSG(text) \
     85# define DEBUG_MSG(text) \
    8586    do {} while (0)
    8687#endif
    8788
    8889#ifdef DEBUG_VERBOSE
    89 #define DEBUG_MSG_1(text) \
     90# define DEBUG_MSG_1(text) \
    9091    DEBUG_MSG(text)
    9192#else
    92 #define DEBUG_MSG_1(text) \
     93# define DEBUG_MSG_1(text) \
    9394    do {} while (0)
    9495#endif
    9596
    9697#ifdef DEBUG_poetzsch
    97 #define CHECK_GL_ERROR()\
     98# define CHECK_GL_ERROR()\
    9899    do \
    99100    { \
     
    123124    }
    124125#else
    125 #define CHECK_GL_ERROR()\
     126# define CHECK_GL_ERROR()\
    126127    do {} while (0)
    127128#endif
    128129
    129130#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);
    144145
    145146#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
    163166 * pixel format used to create that context for later use. */
    164167@interface OverlayOpenGLContext: NSOpenGLContext
     
    173176@class DockOverlayView;
    174177
    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
    178182 * is bind to an OpenGL texture. To display the guest content, an secondary
    179183 * shared OpenGL context of the main OpenGL context is created. The secondary
     
    203207#endif
    204208
    205     /* The corresponding dock tile view of this OpenGL view & all helper
     209    /** The corresponding dock tile view of this OpenGL view & all helper
    206210     * members. */
    207211    DockOverlayView *m_DockTileView;
     
    221225    NSSize           m_Size;
    222226
    223     /* This is necessary for clipping on the root window */
     227    /** This is necessary for clipping on the root window */
    224228    NSPoint          m_RootShift;
    225229}
     
    262266@end
    263267
    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. */
    268275@class OverlayWindow;
    269276@interface OverlayHelperView: NSView
     
    275282@end
    276283
    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
    279288 * transparent & non opaque to make clipping possible. It also disable mouse
    280289 * events and handle frame change events of the parent view. */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette