/** @file * * VirtualBox Windows NT/2000/XP guest OpenGL ICD * * OpenGL extensions * * References: http://oss.sgi.com/projects/ogl-sample/registry/ * http://icps.u-strasbg.fr/~marchesin/perso/extensions/ * * Copyright (C) 2006-2007 innotek GmbH * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of the GNU * General Public License as published by the Free Software Foundation, * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE * distribution. VirtualBox OSE is distributed in the hope that it will * be useful, but WITHOUT ANY WARRANTY of any kind. * * If you received this file as part of a commercial VirtualBox * distribution, then only the terms of your commercial VirtualBox * license agreement apply instead of the previous paragraph. * */ #define VBOX_OGL_WITH_EXTENSION_ARRAY #include "VBoxOGL.h" /** * Initialize OpenGL extensions * * @returns VBox status code * @param pCtx OpenGL thread context */ int vboxInitOpenGLExtensions(PVBOX_OGL_THREAD_CTX pCtx) { char *pszExtensions; static bool fInitialized = false; VBoxOGLglGetString parms; int rc; memset(&parms, 0, sizeof(parms)); VBOX_INIT_CALL(&parms.hdr, GLGETSTRING, pCtx); parms.name.type = VMMDevHGCMParmType_32bit; parms.name.u.value32 = GL_EXTENSIONS; parms.pString.type = VMMDevHGCMParmType_LinAddr; parms.pString.u.Pointer.size = sizeof(szOpenGLExtensions); parms.pString.u.Pointer.u.linearAddr = (vmmDevHypPtr)szOpenGLExtensions; rc = vboxHGCMCall(&parms, sizeof (parms)); if ( VBOX_FAILURE(rc) || VBOX_FAILURE(parms.hdr.result)) { DbgPrintf(("GL_EXTENSIONS failed with %x %x\n", rc, parms.hdr.result)); return FALSE; } DbgPrintf(("GL_EXTENSIONS=%s\n\n", szOpenGLExtensions)); if (fInitialized) return VINF_SUCCESS; pszExtensions = strdup(szOpenGLExtensions); szOpenGLExtensions[0] = 0; for (int i=0;i