vboxgl.cpp revision 648f4eb3997820a317f8aa900598a4b7fe425c23
/** @file
* VBox OpenGL
*/
/*
* 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_CMD_STRINGS
#define VBOX_OGL_WITH_FUNCTION_WRAPPERS
#include "vboxgl.h"
#define LOG_GROUP LOG_GROUP_SHARED_OPENGL
/**
* glGetString implementation
*
* @returns VBox error code
* @param pClient Client context
* @param name glGetString name parameter
* @param pString String pointer
*/
{
int rc = VINF_SUCCESS;
{
goto end;
}
/* force termination */
end:
return rc;
}
/**
* Flush all queued OpenGL commands
*
* @returns VBox error code
* @param pClient Client context
* @param pCmdBuffer Command buffer
* @param cbCmdBuffer Command buffer size
* @param cCommands Number of commands in the buffer
* @param pLastError Pointer to last error (out)
* @param pLastRetVal Pointer to return val of last executed command (out)
*/
int vboxglFlushBuffer(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer, uint32_t cbCmdBuffer, uint32_t cCommands, GLenum *pLastError, uint64_t *pLastRetVal)
{
uint32_t i;
pClient->fHasLastError = false;
for (i=0;i<cCommands;i++)
{
#ifdef VBOX_OGL_CMD_STRICT
AssertMsgReturn(pCmd->Magic == VBOX_OGL_CMD_MAGIC, ("Invalid magic dword %x\n", pCmd->Magic), VERR_INVALID_PARAMETER);
#endif
AssertMsgReturn(pCmd->enmOp < VBOX_OGL_OP_Last, ("Invalid OpenGL cmd %x\n", pCmd->enmOp), VERR_INVALID_PARAMETER);
Log(("Flush cmd %s cParams=%d cbCmd=%x\n", pszVBoxOGLCmd[pCmd->enmOp], pCmd->cParams, pCmd->cbCmd));
/* call wrapper */
AssertMsgReturn(pfnOGLWrapper[pCmd->enmOp], ("No wrapper for opcode %x\n", pCmd->enmOp), VERR_INVALID_PARAMETER);
}
if (pClient->fHasLastError)
else
*pLastError = glGetError();
#ifdef DEBUG
switch(*pLastError)
{
case GL_NO_ERROR:
break;
case GL_INVALID_ENUM:
break;
case GL_INVALID_VALUE:
break;
case GL_INVALID_OPERATION:
break;
case GL_STACK_OVERFLOW:
break;
case GL_STACK_UNDERFLOW:
break;
case GL_OUT_OF_MEMORY:
break;
}
#endif
return VINF_SUCCESS;
}