VirtualBox

Changeset 39206 in vbox


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
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r39204 r39206  
    808808 if "$(VBOX_DARWIN_HOST_VERSION_MAJOR)" == "7" # Lion
    809809  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   endif
    814810 endif
    815811endif
  • trunk/include/VBox/VBoxCocoa.h

    r31665 r39206  
    11/** @file
    2  *
    32 * VBoxCocoa Helper
    43 */
    54
    65/*
    7  * Copyright (C) 2009-2010 Oracle Corporation
     6 * Copyright (C) 2009-2011 Oracle Corporation
    87 *
    98 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2524 */
    2625
    27 #ifndef __VBoxCocoa_h__
    28 #define __VBoxCocoa_h__
     26#ifndef ___VBox_VBoxCocoa_h
     27#define ___VBox_VBoxCocoa_h
    2928
    30 /* Macro which add a typedef of the given Cocoa class in an appropriate form
     29/** Macro which add a typedef of the given Cocoa class in an appropriate form
    3130 * for the current context. This means void* in the C/CPP context and
    3231 * NSWhatever* in the ObjC/ObjCPP context. Use
     
    3534 * right type in the Cocoa context. */
    3635#ifdef __OBJC__
    37 #define ADD_COCOA_NATIVE_REF(CocoaClass) \
    38 @class CocoaClass; \
    39 typedef CocoaClass *Native##CocoaClass##Ref; \
    40 typedef const CocoaClass *ConstNative##CocoaClass##Ref
    41 #else /* __OBJC__ */
    42 #define ADD_COCOA_NATIVE_REF(CocoaClass) \
    43 typedef void *Native##CocoaClass##Ref; \
    44 typedef const void *ConstNative##CocoaClass##Ref
    45 #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__ */
    4645
    47 /* Check for OBJC++ */
     46
     47/*
     48 * Objective-C++ Helpers.
     49 */
    4850#if defined(__OBJC__) && defined (__cplusplus)
    4951
    5052/* Global includes */
    51 #import <Foundation/NSAutoreleasePool.h>
     53# import <Foundation/NSAutoreleasePool.h>
    5254
    53 /* Helper class for automatic creation & destroying of a cocoa auto release
    54    pool. */
     55/** Helper class for automatic creation & destroying of a cocoa auto release
     56 *  pool. */
    5557class CocoaAutoreleasePool
    5658{
     
    6971};
    7072
    71 #endif /* __OBJC__ */
     73#endif /* __OBJC__ && __cplusplus */
    7274
    73 #endif /* __VBoxCocoa_h__ */
     75#endif /* !___VBox_VBoxCocoa_h */
    7476
  • trunk/src/VBox/GuestHost/OpenGL/include/GL/glext.h

    r20147 r39206  
    37183718#endif
    37193719
     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
    37203739#ifndef GL_ARB_shader_objects
    37213740/* GL types for handling shader object handles and program/shader text */
  • 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