glext.cpp revision aacca654fe3844387eee312c25934f9f2b5aff91
/** @file
*
* VBox OpenGL helper functions
*
* OpenGL extensions
*
* References: http://oss.sgi.com/projects/ogl-sample/registry/
*
* 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;
* 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 "vboxgl.h"
#define LOG_GROUP LOG_GROUP_SHARED_OPENGL
/**
* Initialize OpenGL extensions
*
* @returns VBox error code
*/
int vboxInitOpenGLExtensions()
{
static bool fInitialized = false;
if (fInitialized)
return VINF_SUCCESS;
for (int i=0;i<RT_ELEMENTS(OpenGLExtensions);i++)
{
{
*OpenGLExtensions[i].ppfnFunction = vboxDrvIsExtensionAvailable((char *)OpenGLExtensions[i].pszExtFunctionName);
}
}
fInitialized = true;
return VINF_SUCCESS;
}
/**
* Check if an opengl extension function is available
*
* @returns VBox error code
* @param pszFunctionName OpenGL extension function name
*/
bool vboxwglGetProcAddress(char *pszFunctionName)
{
for (int i=0;i<RT_ELEMENTS(OpenGLExtensions);i++)
{
if ( OpenGLExtensions[i].fAvailable
{
return true;
}
}
return false;
}
{
if (!pClient->lastretval)
pClient->fHasLastError = true;
}
{
if (!pClient->lastretval)
pClient->fHasLastError = true;
}