VirtualBox

Changeset 76253 in vbox for trunk


Ignore:
Timestamp:
Dec 16, 2018 3:01:28 PM (6 years ago)
Author:
vboxsync
Message:

DevVGA-SVGA3d: dynamic loading of OpenGL: use function pointer type

Location:
trunk/src/VBox/Devices/Graphics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.cpp

    r76248 r76253  
    8282#else
    8383# define OGLGETPROCADDRESS MyGLXGetProcAddress
    84 static void *MyGLXGetProcAddress(const char *pszSymbol)
     84static PFNRT MyGLXGetProcAddress(const char *pszSymbol)
    8585{
    8686    int rc;
     
    9999    }
    100100
    101     typedef void * (* PFNGLXGETPROCADDRESS)(const GLubyte * procName);
     101    typedef PFNRT (* PFNGLXGETPROCADDRESS)(const GLubyte * procName);
    102102    static PFNGLXGETPROCADDRESS s_glXGetProcAddress = NULL;
    103103    if (s_glXGetProcAddress == NULL)
     
    112112    }
    113113
    114     void *p = s_glXGetProcAddress((const GLubyte *)pszSymbol);
     114    PFNRT p = s_glXGetProcAddress((const GLubyte *)pszSymbol);
    115115    if (RT_VALID_PTR(p))
    116116        return p;
     
    126126
    127127#define GLGETPROC_(ProcName, NameSuffix) do { \
    128     *(void **)&pfn_##ProcName = OGLGETPROCADDRESS(#ProcName NameSuffix); \
     128    *(PFNRT *)&pfn_##ProcName = OGLGETPROCADDRESS(#ProcName NameSuffix); \
    129129    AssertLogRelMsgReturn(pfn_##ProcName, ("%s missing\n", #ProcName NameSuffix), VERR_NOT_IMPLEMENTED); \
    130130} while(0)
     
    289289}
    290290
    291 void *glLdrGetProcAddress(const char *pszSymbol)
     291PFNRT glLdrGetProcAddress(const char *pszSymbol)
    292292{
    293293    return OGLGETPROCADDRESS(pszSymbol);
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h

    r76247 r76253  
    2222# error "This include file is for VMSVGA3D_OPENGL."
    2323#endif
     24
     25#include <iprt/types.h>
    2426
    2527/** @todo VBOX_VMSVGA3D_GL_HACK_LEVEL is not necessary when dynamic loading is used. */
     
    7981int glLdrInit(void);
    8082/* Resolve an OpenGL function name. */
    81 void *glLdrGetProcAddress(const char *pszSymbol);
     83PFNRT glLdrGetProcAddress(const char *pszSymbol);
    8284/* Get pointers to extension function. They are available on Windows only when OpenGL context is set. */
    8385int glLdrGetExtFunctions(void);
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp

    r76252 r76253  
    6565
    6666#ifdef VMSVGA3D_DYNAMIC_LOAD
    67 # define OGLGETPROCADDRESS(x)   glLdrGetProcAddress(x)
     67# define OGLGETPROCADDRESS glLdrGetProcAddress
    6868#else
    6969#ifdef RT_OS_WINDOWS
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