VirtualBox

Changeset 30126 in vbox for trunk


Ignore:
Timestamp:
Jun 9, 2010 3:15:52 PM (15 years ago)
Author:
vboxsync
Message:

OpenGL-OSX: use new VBoxCocoa.h include file

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxCocoa.h

    r30122 r30126  
    3636#endif /* __OBJC__ */
    3737
    38 #ifdef __OBJC__
     38/* Check for OBJC++ */
     39#if defined(__OBJC__) && defined (__cplusplus)
    3940
    4041/* Global includes */
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h

    r28280 r30126  
    100100    /* unsigned long context_ptr; */
    101101# else
    102     NativeViewRef window;
    103     NativeViewRef nativeWindow; /**< for render_to_app_window */
    104     NativeGLCtxRef *currentCtx;
     102    NativeNSViewRef window;
     103    NativeNSViewRef nativeWindow; /**< for render_to_app_window */
     104    NativeNSOpenGLContextRef *currentCtx;
    105105# endif
    106106#elif defined(GLX)
     
    134134    AGLContext context;
    135135# else
    136     NativeGLCtxRef context;
     136    NativeNSOpenGLContextRef context;
    137137# endif
    138138#elif defined(GLX)
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c

    r29175 r30126  
    7979
    8080#ifdef __LP64__
    81     NativeViewRef pParentWin = (NativeViewRef)render_spu_parent_window_id;
     81    NativeNSViewRef pParentWin = (NativeNSViewRef)render_spu_parent_window_id;
    8282#else /* __LP64__ */
    83     NativeViewRef pParentWin = (NativeViewRef)(uint32_t)render_spu_parent_window_id;
     83    NativeNSViewRef pParentWin = (NativeNSViewRef)(uint32_t)render_spu_parent_window_id;
    8484#endif /* __LP64__ */
    8585
     
    9595{
    9696#ifdef __LP64__
    97     NativeViewRef pParentWin = (NativeViewRef)render_spu_parent_window_id;
     97    NativeNSViewRef pParentWin = (NativeNSViewRef)render_spu_parent_window_id;
    9898#else /* __LP64__ */
    99     NativeViewRef pParentWin = (NativeViewRef)(uint32_t)render_spu_parent_window_id;
     99    NativeNSViewRef pParentWin = (NativeNSViewRef)(uint32_t)render_spu_parent_window_id;
    100100#endif /* __LP64__ */
    101101    cocoaViewReparent(pWinInfo->window, pParentWin);
     
    114114
    115115#ifdef __LP64__
    116     NativeViewRef pParentWin = (NativeViewRef)render_spu_parent_window_id;
     116    NativeNSViewRef pParentWin = (NativeNSViewRef)render_spu_parent_window_id;
    117117#else /* __LP64__ */
    118     NativeViewRef pParentWin = (NativeViewRef)(uint32_t)render_spu_parent_window_id;
     118    NativeNSViewRef pParentWin = (NativeNSViewRef)(uint32_t)render_spu_parent_window_id;
    119119#endif /* __LP64__ */
    120120
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.h

    r28800 r30126  
    1919#define __renderspu_cocoa_helper_h
    2020
    21 #ifdef __OBJC__
    22 # import <Cocoa/Cocoa.h>
    23 typedef NSView *NativeViewRef;
    24 typedef NSOpenGLContext *NativeGLCtxRef;
    25 #else /* __OBJC__ */
    26 typedef void *NativeViewRef;
    27 typedef void *NativeGLCtxRef;
    28 #endif /* __OBJC__ */
    29 
     21#include <VBox/VBoxCocoa.h>
    3022#include <iprt/cdefs.h>
    3123#include <OpenGL/OpenGL.h>
     
    3325RT_C_DECLS_BEGIN
    3426
     27ADD_COCOA_NATIVE_REF(NSView);
     28ADD_COCOA_NATIVE_REF(NSOpenGLContext);
     29
    3530/* OpenGL context management */
    36 void cocoaGLCtxCreate(NativeGLCtxRef *ppCtx, GLbitfield fVisParams);
    37 void cocoaGLCtxDestroy(NativeGLCtxRef pCtx);
     31void cocoaGLCtxCreate(NativeNSOpenGLContextRef *ppCtx, GLbitfield fVisParams);
     32void cocoaGLCtxDestroy(NativeNSOpenGLContextRef pCtx);
    3833
    3934/* View management */
    40 void cocoaViewCreate(NativeViewRef *ppView, NativeViewRef pParentView, GLbitfield fVisParams);
    41 void cocoaViewReparent(NativeViewRef pView, NativeViewRef pParentView);
    42 void cocoaViewDestroy(NativeViewRef pView);
    43 void cocoaViewDisplay(NativeViewRef pView);
    44 void cocoaViewShow(NativeViewRef pView, GLboolean fShowIt);
    45 void cocoaViewSetPosition(NativeViewRef pView, NativeViewRef pParentView, int x, int y);
    46 void cocoaViewSetSize(NativeViewRef pView, int w, int h);
    47 void cocoaViewGetGeometry(NativeViewRef pView, int *pX, int *pY, int *pW, int *pH);
     35void cocoaViewCreate(NativeNSViewRef *ppView, NativeNSViewRef pParentView, GLbitfield fVisParams);
     36void cocoaViewReparent(NativeNSViewRef pView, NativeNSViewRef pParentView);
     37void cocoaViewDestroy(NativeNSViewRef pView);
     38void cocoaViewDisplay(NativeNSViewRef pView);
     39void cocoaViewShow(NativeNSViewRef pView, GLboolean fShowIt);
     40void cocoaViewSetPosition(NativeNSViewRef pView, NativeNSViewRef pParentView, int x, int y);
     41void cocoaViewSetSize(NativeNSViewRef pView, int w, int h);
     42void cocoaViewGetGeometry(NativeNSViewRef pView, int *pX, int *pY, int *pW, int *pH);
    4843
    49 void cocoaViewMakeCurrentContext(NativeViewRef pView, NativeGLCtxRef pCtx);
    50 void cocoaViewSetVisibleRegion(NativeViewRef pView, GLint cRects, GLint* paRects);
     44void cocoaViewMakeCurrentContext(NativeNSViewRef pView, NativeNSOpenGLContextRef pCtx);
     45void cocoaViewSetVisibleRegion(NativeNSViewRef pView, GLint cRects, GLint* paRects);
    5146
    5247/* OpenGL wrapper */
    53 void cocoaFlush();
    54 void cocoaFinish();
     48void cocoaFlush(void);
     49void cocoaFinish(void);
    5550void cocoaBindFramebufferEXT(GLenum target, GLuint framebuffer);
    5651
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m

    r29447 r30126  
    1717
    1818#include "renderspu_cocoa_helper.h"
     19
     20#import <Cocoa/Cocoa.h>
    1921
    2022#include "chromium.h" /* For the visual bits of chromium */
     
    13021304*
    13031305********************************************************************************/
    1304 void cocoaGLCtxCreate(NativeGLCtxRef *ppCtx, GLbitfield fVisParams)
     1306void cocoaGLCtxCreate(NativeNSOpenGLContextRef *ppCtx, GLbitfield fVisParams)
    13051307{
    13061308    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
     
    13821384}
    13831385
    1384 void cocoaGLCtxDestroy(NativeGLCtxRef pCtx)
     1386void cocoaGLCtxDestroy(NativeNSOpenGLContextRef pCtx)
    13851387{
    13861388    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
     
    13961398*
    13971399********************************************************************************/
    1398 void cocoaViewCreate(NativeViewRef *ppView, NativeViewRef pParentView, GLbitfield fVisParams)
     1400void cocoaViewCreate(NativeNSViewRef *ppView, NativeNSViewRef pParentView, GLbitfield fVisParams)
    13991401{
    14001402    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
     
    14141416}
    14151417
    1416 void cocoaViewReparent(NativeViewRef pView, NativeViewRef pParentView)
     1418void cocoaViewReparent(NativeNSViewRef pView, NativeNSViewRef pParentView)
    14171419{
    14181420    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
     
    14421444}
    14431445
    1444 void cocoaViewDestroy(NativeViewRef pView)
     1446void cocoaViewDestroy(NativeNSViewRef pView)
    14451447{
    14461448    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
     
    14711473}
    14721474
    1473 void cocoaViewShow(NativeViewRef pView, GLboolean fShowIt)
     1475void cocoaViewShow(NativeNSViewRef pView, GLboolean fShowIt)
    14741476{
    14751477    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
     
    14801482}
    14811483
    1482 void cocoaViewDisplay(NativeViewRef pView)
     1484void cocoaViewDisplay(NativeNSViewRef pView)
    14831485{   
    14841486    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
     
    14911493}
    14921494
    1493 void cocoaViewSetPosition(NativeViewRef pView, NativeViewRef pParentView, int x, int y)
     1495void cocoaViewSetPosition(NativeNSViewRef pView, NativeNSViewRef pParentView, int x, int y)
    14941496{
    14951497    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
     
    15001502}
    15011503
    1502 void cocoaViewSetSize(NativeViewRef pView, int w, int h)
     1504void cocoaViewSetSize(NativeNSViewRef pView, int w, int h)
    15031505{
    15041506    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
     
    15091511}
    15101512
    1511 void cocoaViewGetGeometry(NativeViewRef pView, int *pX, int *pY, int *pW, int *pH)
     1513void cocoaViewGetGeometry(NativeNSViewRef pView, int *pX, int *pY, int *pW, int *pH)
    15121514{
    15131515    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
     
    15221524}
    15231525
    1524 void cocoaViewMakeCurrentContext(NativeViewRef pView, NativeGLCtxRef pCtx)
     1526void cocoaViewMakeCurrentContext(NativeNSViewRef pView, NativeNSOpenGLContextRef pCtx)
    15251527{
    15261528    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
    15271529
    1528     DEBUG_MSG(("cocoaViewMakeCurrentContext(%p, %p)\n", pView, pCtx));
     1530    DEBUG_MSG(("cocoaViewMakeCurrentContext(%p, %p)\n", (void*)pView, (void*)pCtx));
    15291531   
    15301532    [(OverlayView*)pView setGLCtx:pCtx];
     
    15341536}
    15351537
    1536 void cocoaViewSetVisibleRegion(NativeViewRef pView, GLint cRects, GLint* paRects)
     1538void cocoaViewSetVisibleRegion(NativeNSViewRef pView, GLint cRects, GLint* paRects)
    15371539{
    15381540    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
     
    15481550*
    15491551********************************************************************************/
    1550 void cocoaFlush()
     1552void cocoaFlush(void)
    15511553{
    15521554    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
     
    15751577}
    15761578
    1577 void cocoaFinish()
     1579void cocoaFinish(void)
    15781580{
    15791581    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
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