Changeset 3460 in vbox for trunk/src/VBox/Additions/WINNT
- Timestamp:
- Jul 5, 2007 12:56:04 PM (18 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/OpenGL
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/OpenGL/VBoxOGL.cpp
r3440 r3460 470 470 return parms.retval.u.value64; 471 471 } 472 473 /** 474 * Check if an OpenGL extension is available on the host 475 * 476 * @returns available or not 477 * @param pszExtFunctionName 478 */ 479 bool VBoxIsExtensionAvailable(const char *pszExtFunctionName) 480 { 481 PVBOX_OGL_THREAD_CTX pCtx = VBoxOGLGetThreadCtx(); 482 VBoxOGLglCheckExt parms; 483 484 AssertReturn(pCtx->pCurrentCmd > pCtx->pCmdBuffer, 0); 485 486 VBOX_INIT_CALL(&parms.hdr, GLCHECKEXT, pCtx); 487 488 parms.pszExtFnName.type = VMMDevHGCMParmType_LinAddr_In; 489 parms.pszExtFnName.u.Pointer.size = strlen(pszExtFunctionName)+1; 490 parms.pszExtFnName.u.Pointer.u.linearAddr = (vmmDevHypPtr)pszExtFunctionName; 491 492 int rc = vboxHGCMCall(vboxOGLCtx.hGuestDrv, &parms, sizeof (parms)); 493 494 if ( VBOX_FAILURE(rc) 495 || VBOX_FAILURE(parms.hdr.result)) 496 { 497 DbgPrintf(("GLCHECKEXT failed with %x %x\n", rc, parms.hdr.result)); 498 return false; 499 } 500 501 return true; 502 } -
trunk/src/VBox/Additions/WINNT/Graphics/OpenGL/VBoxOGL.h
r3443 r3460 198 198 199 199 /** 200 * Check if an OpenGL extension is available on the host 201 * 202 * @returns available or not 203 * @param pszExtFunctionName 204 */ 205 bool VBoxIsExtensionAvailable(const char *pszExtFunctionName); 206 207 /** 200 208 * Query the specified cached parameter 201 209 * -
trunk/src/VBox/Additions/WINNT/Graphics/OpenGL/drv.cpp
r3438 r3460 64 64 65 65 66 67 PROC APIENTRY DrvGetProcAddress(LPCSTR lpszProc)68 {69 PROC pfnProc = GetProcAddress(hDllVBoxOGL, lpszProc);70 if (pfnProc == NULL)71 DbgPrintf(("DrvGetProcAddress %s FAILED\n", lpszProc));72 else73 DbgPrintf(("DrvGetProcAddress %s\n", lpszProc));74 75 return pfnProc;76 }77 66 78 67 BOOL APIENTRY DrvValidateVersion(DWORD version) -
trunk/src/VBox/Additions/WINNT/Graphics/OpenGL/glext.cpp
r3451 r3460 25 25 26 26 #include "VBoxOGL.h" 27 #define WGL_WGLEXT_PROTOTYPES 27 28 #include <VBox/HostServices/wglext.h> 29 30 typedef struct 31 { 32 const char *pszExtName; 33 const char *pszExtFunctionName; 34 RTUINTPTR pfnFunction; 35 bool fAvailable; 36 } OPENGL_EXT, *POPENGL_EXT; 37 38 static OPENGL_EXT OpenGLExtensions[] = 39 { 40 { "WGL_EXT_swap_control", "wglSwapIntervalEXT", (RTUINTPTR)wglSwapIntervalEXT, false }, 41 { "WGL_EXT_swap_control", "wglGetSwapIntervalEXT", (RTUINTPTR)wglGetSwapIntervalEXT, false }, 42 }; 43 44 45 int vboxInitOpenGLExtensions() 46 { 47 const GLubyte *pszExtensions = glGetString(GL_EXTENSIONS); 48 49 for (int i=0;i<RT_ELEMENTS(OpenGLExtensions);i++) 50 { 51 if (strstr((char *)pszExtensions, OpenGLExtensions[i].pszExtFunctionName)) 52 OpenGLExtensions[i].fAvailable = VBoxIsExtensionAvailable(OpenGLExtensions[i].pszExtFunctionName); 53 } 54 return VINF_SUCCESS; 55 } 56 57 58 PROC APIENTRY DrvGetProcAddress(LPCSTR lpszProc) 59 { 60 PROC pfnProc; 61 62 for (int i=0;i<RT_ELEMENTS(OpenGLExtensions);i++) 63 { 64 if ( OpenGLExtensions[i].fAvailable 65 && !strcmp(OpenGLExtensions[i].pszExtFunctionName, lpszProc)) 66 { 67 pfnProc = (PROC)OpenGLExtensions[i].pfnFunction; 68 } 69 } 70 if (pfnProc == NULL) 71 DbgPrintf(("DrvGetProcAddress %s FAILED\n", lpszProc)); 72 else 73 DbgPrintf(("DrvGetProcAddress %s\n", lpszProc)); 74 75 return pfnProc; 76 } 77 78 BOOL WINAPI wglSwapIntervalEXT(int interval) 79 { 80 VBOX_OGL_GEN_SYNC_OP1_RET(BOOL, wglSwapIntervalEXT, interval); 81 return retval; 82 } 83 84 int WINAPI wglGetSwapIntervalEXT(void) 85 { 86 VBOX_OGL_GEN_SYNC_OP_RET(int, wglGetSwapIntervalEXT); 87 return retval; 88 } 89 90 91 92 28 93 29 94 #if 0 … … 104 169 GL_WIN_swap_hint 105 170 WGL_EXT_extensions_string 106 WGL_EXT_swap_control107 171 #endif 108 172 109 110 BOOL WINAPI wglSwapIntervalEXT(int interval)111 {112 VBOX_OGL_GEN_SYNC_OP1_RET(BOOL, wglSwapIntervalEXT, interval);113 return retval;114 }115 116 int WINAPI wglGetSwapIntervalEXT(void)117 {118 VBOX_OGL_GEN_SYNC_OP_RET(int, wglGetSwapIntervalEXT);119 return retval;120 }121
Note:
See TracChangeset
for help on using the changeset viewer.