VirtualBox

Ignore:
Timestamp:
Apr 7, 2009 3:44:27 PM (16 years ago)
Author:
vboxsync
Message:

crOpenGL-OSX: Do an additional check if we are initialized when we get messages from the Qt thread.

Location:
trunk/src/VBox/HostServices/SharedOpenGL/render
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h

    r18721 r18830  
    224224    GLint currentBufferName;
    225225    uint64_t uiDockUpdateTS;
     226    bool fInit;
    226227#endif /* RT_OS_DARWIN */
    227228} RenderSPU;
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_agl.c

    r18721 r18830  
    109109    UInt32      class = GetEventClass (event);
    110110    UInt32      kind = GetEventKind (event);
     111
     112    /* If we aren't initialized or even deinitialized already (as on VM
     113     * shutdown) do nothing. */
     114    if (!render_spu.fInit)
     115        return eventNotHandledErr;
    111116
    112117    /* Fetch the sender of the event */
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_init.c

    r18722 r18830  
    3939    crNetInit(NULL, NULL);
    4040
    41     if (!crParseURL( render_spu.swap_master_url, protocol, hostname, 
     41    if (!crParseURL( render_spu.swap_master_url, protocol, hostname,
    4242                    &port, 9876))
    4343        crError( "Bad URL: %s", render_spu.swap_master_url );
     
    7474    (void) unused;
    7575
    76     /* Force system to create the message queue. 
     76    /* Force system to create the message queue.
    7777     * Else, there's a chance that render spu will issue PostThreadMessage
    7878     * before this thread calls GetMessage for first time.
     
    102102
    103103                *phWnd = CreateWindowEx(pCS->dwExStyle, pCS->lpszName, pCS->lpszClass, pCS->style,
    104                                         pCS->x, pCS->y, pCS->cx, pCS->cy, 
     104                                        pCS->x, pCS->y, pCS->cx, pCS->cy,
    105105                                        pCS->hwndParent, pCS->hMenu, pCS->hInstance, &render_spu);
    106106
     
    117117            else
    118118            {
    119                 TranslateMessage(&msg); 
     119                TranslateMessage(&msg);
    120120                DispatchMessage(&msg);
    121121            }
     
    239239                                    GetEventTypeCount(eventList), eventList,
    240240                                    NULL, NULL);
     241    render_spu.fInit = true;
    241242# endif /* !__LP64__ */
    242243#endif /* DARWIN */
     
    269270    /*
    270271     * Get the OpenGL extension functions.
    271      * SIGH -- we have to wait until the very bitter end to load the 
     272     * SIGH -- we have to wait until the very bitter end to load the
    272273     * extensions, because the context has to be bound before
    273274     * wglGetProcAddress will work correctly.  No such issue with GLX though.
     
    285286     * but ARB for others. Need furthur testing here....
    286287     */
    287     render_spu.ws.wglGetExtensionsStringEXT = 
    288         (wglGetExtensionsStringEXTFunc_t) 
     288    render_spu.ws.wglGetExtensionsStringEXT =
     289        (wglGetExtensionsStringEXTFunc_t)
    289290        render_spu.ws.wglGetProcAddress( "wglGetExtensionsStringEXT" );
    290     render_spu.ws.wglChoosePixelFormatEXT = 
     291    render_spu.ws.wglChoosePixelFormatEXT =
    291292        (wglChoosePixelFormatEXTFunc_t)
    292293        render_spu.ws.wglGetProcAddress( "wglChoosePixelFormatARB" );
    293     render_spu.ws.wglGetPixelFormatAttribivEXT = 
     294    render_spu.ws.wglGetPixelFormatAttribivEXT =
    294295        (wglGetPixelFormatAttribivEXTFunc_t)
    295296        render_spu.ws.wglGetProcAddress( "wglGetPixelFormatAttribivARB" );
    296     render_spu.ws.wglGetPixelFormatAttribfvEXT = 
     297    render_spu.ws.wglGetPixelFormatAttribfvEXT =
    297298        (wglGetPixelFormatAttribfvEXTFunc_t)
    298299        render_spu.ws.wglGetProcAddress( "wglGetPixelFormatAttribfvARB" );
     
    301302    {
    302303        _cr_render_table[numFuncs].name = crStrdup("TexImage3D");
    303         _cr_render_table[numFuncs].fn = (SPUGenericFunction) render_spu.ws.wglGetProcAddress("glTexImage3D");       
     304        _cr_render_table[numFuncs].fn = (SPUGenericFunction) render_spu.ws.wglGetProcAddress("glTexImage3D");
    304305        ++numFuncs;
    305306        crDebug("Render SPU: Found glTexImage3D function");
     
    361362#ifdef RT_OS_DARWIN
    362363# ifndef __LP64__ /** @todo port to 64-bit darwin. */
     364    render_spu.fInit = false;
    363365    DisposeEventHandlerUPP(render_spu.hParentEventHandler);
    364366    ReleaseWindowGroup(render_spu.pMasterGroup);
     
    402404    *options = renderSPUOptions;
    403405    *flags = (SPU_NO_PACKER|SPU_IS_TERMINAL|SPU_MAX_SERVERS_ZERO);
    404    
     406
    405407    return 1;
    406408}
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