VirtualBox

Changeset 76245 in vbox


Ignore:
Timestamp:
Dec 15, 2018 6:18:19 PM (6 years ago)
Author:
vboxsync
Message:

DevVGA-SVGA3d: more for dynamic loading of opengl

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

Legend:

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

    r76241 r76245  
    118118#define GLGETPROC_(ProcName, NameSuffix) do { \
    119119    *(void **)&pfn_##ProcName = OGLGETPROCADDRESS(#ProcName NameSuffix); \
    120     AssertLogRelMsgReturn(pfn_##ProcName, (#ProcName NameSuffix " missing\n"), VERR_NOT_IMPLEMENTED); \
     120    AssertLogRelMsgReturn(pfn_##ProcName, ("%s missing\n", #ProcName NameSuffix), VERR_NOT_IMPLEMENTED); \
    121121} while(0)
    122122
    123123int glLdrInit(void)
    124124{
     125    pfn_glAlphaFunc = 0;
     126    pfn_glBindTexture = 0;
     127    pfn_glBlendColor = 0;
     128    pfn_glBlendEquation = 0;
     129    pfn_glBlendFunc = 0;
     130    pfn_glClear = 0;
     131    pfn_glClearColor = 0;
     132    pfn_glClearDepth = 0;
     133    pfn_glClearStencil = 0;
     134    pfn_glClientActiveTexture = 0;
     135    pfn_glClipPlane = 0;
     136    pfn_glColorMask = 0;
     137    pfn_glColorPointer = 0;
     138    pfn_glCullFace = 0;
     139    pfn_glDeleteTextures = 0;
     140    pfn_glDepthFunc = 0;
     141    pfn_glDepthMask = 0;
     142    pfn_glDepthRange = 0;
     143    pfn_glDisable = 0;
     144    pfn_glDisableClientState = 0;
     145    pfn_glDrawArrays = 0;
     146    pfn_glDrawElements = 0;
     147    pfn_glEnable = 0;
     148    pfn_glEnableClientState = 0;
     149    pfn_glFogf = 0;
     150    pfn_glFogfv = 0;
     151    pfn_glFogi = 0;
     152    pfn_glFrontFace = 0;
     153    pfn_glGenTextures = 0;
     154    pfn_glGetBooleanv = 0;
     155    pfn_glGetError = 0;
     156    pfn_glGetFloatv = 0;
     157    pfn_glGetIntegerv = 0;
     158    pfn_glGetString = 0;
     159    pfn_glGetTexImage = 0;
     160    pfn_glLightModelfv = 0;
     161    pfn_glLightf = 0;
     162    pfn_glLightfv = 0;
     163    pfn_glLineWidth = 0;
     164    pfn_glLoadIdentity = 0;
     165    pfn_glLoadMatrixf = 0;
     166    pfn_glMaterialfv = 0;
     167    pfn_glMatrixMode = 0;
     168    pfn_glMultMatrixf = 0;
     169    pfn_glNormalPointer = 0;
     170    pfn_glPixelStorei = 0;
     171    pfn_glPointSize = 0;
     172    pfn_glPolygonMode = 0;
     173    pfn_glPolygonOffset = 0;
     174    pfn_glPopAttrib = 0;
     175    pfn_glPopMatrix = 0;
     176    pfn_glPushAttrib = 0;
     177    pfn_glPushMatrix = 0;
     178    pfn_glScissor = 0;
     179    pfn_glShadeModel = 0;
     180    pfn_glStencilFunc = 0;
     181    pfn_glStencilMask = 0;
     182    pfn_glStencilOp = 0;
     183    pfn_glTexCoordPointer = 0;
     184    pfn_glTexImage2D = 0;
     185    pfn_glTexParameterf = 0;
     186    pfn_glTexParameterfv = 0;
     187    pfn_glTexParameteri = 0;
     188    pfn_glTexSubImage2D = 0;
     189    pfn_glVertexPointer = 0;
     190    pfn_glViewport = 0;
     191
    125192    GLGETPROC_(glAlphaFunc, "");
    126193    GLGETPROC_(glBindTexture, "");
     
    199266    return OGLGETPROCADDRESS(pszSymbol);
    200267}
     268
     269int glLdrGetExtFunctions(void)
     270{
     271    GLGETPROC_(glBlendColor, "");
     272    GLGETPROC_(glBlendEquation, "");
     273    GLGETPROC_(glClientActiveTexture, "");
     274    return VINF_SUCCESS;
     275}
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h

    r76241 r76245  
    2222# error "This include file is for VMSVGA3D_OPENGL."
    2323#endif
     24
     25/** @todo VBOX_VMSVGA3D_GL_HACK_LEVEL is not necessary when dynamic loading is used. */
    2426
    2527#ifdef RT_OS_WINDOWS
     
    6264#ifdef RT_OS_WINDOWS
    6365# define GLAPIENTRY APIENTRY
    64 
    6566#else
    66 ...
     67# define GLAPIENTRY
    6768#endif
    6869
     
    7778/* Load OpenGL library and initialize function pointers. */
    7879int glLdrInit(void);
     80/* Resolve an OpenGL function name. */
    7981void *glLdrGetProcAddress(const char *pszSymbol);
     82/* Get pointers to extension function. They are available on Windows only when OpenGL context is set. */
     83int glLdrGetExtFunctions(void);
    8084
    8185/*
     
    8387 */
    8488
     89/*
     90 * GL 1.1 functions (exported from OpenGL32 on Windows).
     91 */
    8592GLPFN void (GLAPIENTRYP pfn_glAlphaFunc)(GLenum func, GLclampf ref);
    8693#define glAlphaFunc pfn_glAlphaFunc
     
    272279#define glViewport pfn_glViewport
    273280
     281/*
     282 * Extension functions (not exported from OpenGL32 on Windows).
     283 */
     284GLPFN void (GLAPIENTRYP pfn_glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
     285#define glBlendColor pfn_glBlendColor
     286
     287GLPFN void (GLAPIENTRYP pfn_glBlendEquation)(GLenum mode);
     288#define glBlendEquation pfn_glBlendEquation
     289
     290GLPFN void (GLAPIENTRYP pfn_glClientActiveTexture)(GLenum texture);
     291#define glClientActiveTexture pfn_glClientActiveTexture
     292
    274293#ifdef RT_OS_WINDOWS
     294/*
     295 * WGL.
     296 */
    275297GLPFN HGLRC (WINAPI *pfn_wglCreateContext)(HDC);
    276298#define wglCreateContext pfn_wglCreateContext
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