VirtualBox

Ignore:
Timestamp:
Aug 27, 2009 11:46:29 AM (15 years ago)
Author:
vboxsync
Message:

crOpenGL-OSX: Initial version for the Cocoa port.

Location:
trunk/src/VBox/HostServices/SharedOpenGL
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/Makefile.kmk

    r22335 r22509  
    234234VBoxOGLrenderspu_SOURCES.solaris = render/renderspu_glx.c
    235235VBoxOGLrenderspu_SOURCES.freebsd = render/renderspu_glx.c
    236 VBoxOGLrenderspu_SOURCES.darwin  = render/renderspu_agl.c
     236ifdef VBOX_WITH_COCOA_QT
     237 VBoxOGLrenderspu_SOURCES.darwin = \
     238    render/renderspu_cocoa.c \
     239    render/renderspu_cocoa_helper.m
     240 VBoxOGLrenderspu_LDFLAGS.darwin += -framework AppKit
     241else
     242 VBoxOGLrenderspu_SOURCES.darwin = render/renderspu_agl.c
     243endif
    237244VBoxOGLrenderspu_LDFLAGS.darwin += -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxOGLrenderspu.dylib
    238245VBoxOGLrenderspu_LIBS = \
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c

    r20921 r22509  
    10151015
    10161016#if defined(DARWIN)
     1017# ifdef VBOX_WITH_COCOA_QT
    10171018void renderspuFlush()
    10181019{
    1019     glFlush();
     1020    renderspu_SystemFlush();
    10201021}
    10211022
    10221023void renderspuFinish()
    10231024{
    1024     glFinish();
    1025 }
     1025    renderspu_SystemFinish();
     1026}
     1027
     1028void renderspuBindFramebufferEXT(GLenum target, GLuint framebuffer)
     1029{
     1030    renderspu_SystemBindFramebufferEXT(target, framebuffer);
     1031}
     1032# endif
    10261033#endif
    10271034
     
    10631070    FILLIN( "GetString", renderspuGetString );
    10641071#if defined(DARWIN)
     1072# ifdef VBOX_WITH_COCOA_QT
     1073    FILLIN( "Flush", renderspuFlush );
    10651074    FILLIN( "Finish", renderspuFinish );
    1066     FILLIN( "Flush", renderspuFlush );
     1075    FILLIN( "BindFramebufferEXT", renderspuBindFramebufferEXT );
     1076# endif
    10671077#endif
    10681078    return i;
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h

    r22502 r22509  
    1313#define RENDER_APIENTRY __stdcall
    1414#elif defined(DARWIN)
    15 #include <AGL/AGL.h>
     15# ifndef VBOX_WITH_COCOA_QT
     16#  include <AGL/AGL.h>
     17# else
     18#  include "renderspu_cocoa_helper.h"
     19# endif
    1620#define RENDER_APIENTRY
    1721#else
     
    2933
    3034#ifdef RT_OS_DARWIN
     35# ifndef VBOX_WITH_COCOA_QT
    3136enum
    3237{
     
    4449};
    4550pascal OSStatus windowEvtHndlr(EventHandlerCallRef myHandler, EventRef event, void* userData);
     51# endif
    4652#endif /* RT_OS_DARWIN */
    4753
     
    5561    HDC device_context;
    5662#elif defined(DARWIN)
     63# ifndef VBOX_WITH_COCOA_QT
    5764    WindowRef window;
     65# endif
    5866#elif defined(GLX)
    5967    Display *dpy;
     
    8290    HDC device_context;
    8391#elif defined(DARWIN)
     92# ifndef VBOX_WITH_COCOA_QT
    8493    WindowRef window;
    8594    WindowRef nativeWindow; /**< for render_to_app_window */
     
    9099    RgnHandle hVisibleRegion;
    91100    /* unsigned long context_ptr; */
     101# else
     102    NativeViewRef window;
     103    NativeViewRef nativeWindow; /**< for render_to_app_window */
     104    NativeGLCtxRef *currentCtx;
     105# endif
    92106#elif defined(GLX)
    93107    Window window;
     
    117131    HGLRC hRC;
    118132#elif defined(DARWIN)
     133# ifndef VBOX_WITH_COCOA_QT
    119134    AGLContext context;
     135# else
     136    NativeGLCtxRef context;
     137# endif
    120138#elif defined(GLX)
    121139    GLXContext context;
     
    217235
    218236#ifdef RT_OS_DARWIN
     237# ifndef VBOX_WITH_COCOA_QT
    219238    RgnHandle hRootVisibleRegion;
    220239    RTSEMFASTMUTEX syncMutex;
     
    225244    uint64_t uiDockUpdateTS;
    226245    bool fInit;
     246# endif
    227247#endif /* RT_OS_DARWIN */
    228248} RenderSPU;
     
    278298#ifdef RT_OS_DARWIN
    279299extern void renderspu_SystemSetRootVisibleRegion(GLint cRects, GLint *pRects);
     300# ifdef VBOX_WITH_COCOA_QT
     301extern void renderspu_SystemFlush();
     302extern void renderspu_SystemFinish();
     303extern void renderspu_SystemBindFramebufferEXT(GLenum target, GLuint framebuffer);
     304# endif
    280305#endif
    281306extern void renderspu_SystemShowWindow( WindowInfo *window, GLboolean showIt );
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_init.c

    r22502 r22509  
    214214
    215215#ifdef DARWIN
    216 # ifndef __LP64__ /** @todo port to 64-bit darwin. */
     216# ifdef VBOX_WITH_COCOA_QT
     217# else /* VBOX_WITH_COCOA_QT */
    217218    render_spu.hRootVisibleRegion = 0;
    218219    render_spu.currentBufferName = 1;
     
    240241                                    NULL, NULL);
    241242    render_spu.fInit = true;
    242 # endif /* !__LP64__ */
     243# endif /* VBOX_WITH_COCOA_QT */
    243244#endif /* DARWIN */
    244245
     
    386387
    387388#ifdef RT_OS_DARWIN
    388 # ifndef __LP64__ /** @todo port to 64-bit darwin. */
     389# ifndef VBOX_WITH_COCOA_QT
    389390    render_spu.fInit = false;
    390391    DisposeEventHandlerUPP(render_spu.hParentEventHandler);
     
    399400    render_spu.uiDockUpdateTS = 0;
    400401    RTSemFastMutexDestroy(render_spu.syncMutex);
    401 # endif /* __LP64__ */
     402# else /* VBOX_WITH_COCOA_QT */
     403# endif /* VBOX_WITH_COCOA_QT */
    402404#endif /* RT_OS_DARWIN */
    403405
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