vboxgl.cpp revision cca8c8c55206ccd60f1b32843a67ce737447ac60
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * VBox OpenGL
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * available from http://www.virtualbox.org. This file is free software;
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * you can redistribute it and/or modify it under the terms of the GNU
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * General Public License (GPL) as published by the Free Software
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
a3d06a524c4f1cde2f0eada83656543d5a24115dvboxsync * additional information or have any questions.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * glGetString implementation
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * @returns VBox error code
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * @param pClient Client context
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * @param name glGetString name parameter
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * @param pString String pointer
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * @param pcbString String length (in/out)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncint vboxglGetString(VBOXOGLCTX *pClient, GLenum name, char *pString, uint32_t *pcbString)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync /* force termination */
c48c4d769ded37e2496f97dddbbd36dc62f244b1vboxsync * Flush all queued OpenGL commands
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * @returns VBox error code
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * @param pClient Client context
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * @param pCmdBuffer Command buffer
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * @param cbCmdBuffer Command buffer size
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * @param cCommands Number of commands in the buffer
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * @param pLastError Pointer to last error (out)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync * @param pLastRetVal Pointer to return val of last executed command (out)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncint vboxglFlushBuffer(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer, uint32_t cbCmdBuffer, uint32_t cCommands, GLenum *pLastError, uint64_t *pLastRetVal)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync Log(("vboxglFlushBuffer cCommands=%d cbCmdBuffer=%x\n", cCommands, cbCmdBuffer));
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync for (i=0;i<cCommands;i++)
c6adb272ec43d5eaadb1493cb2bf45f2f8adf588vboxsync Assert(((RTHCUINTPTR)pCmdBuffer & VBOX_OGL_CMD_ALIGN_MASK) == 0);
c48c4d769ded37e2496f97dddbbd36dc62f244b1vboxsync AssertMsgReturn(pCmd->Magic == VBOX_OGL_CMD_MAGIC, ("Invalid magic dword %x\n", pCmd->Magic), VERR_INVALID_PARAMETER);
257927abbaa6d9774427049fcbea552cda362281vboxsync AssertMsgReturn(pCmd->enmOp < VBOX_OGL_OP_Last, ("Invalid OpenGL cmd %x\n", pCmd->enmOp), VERR_INVALID_PARAMETER);
24a8dd4360c4b4588fd2c340dd7687379a45e02evboxsync Log(("Flush cmd %s cParams=%d cbCmd=%x\n", pszVBoxOGLCmd[pCmd->enmOp], pCmd->cParams, pCmd->cbCmd));
c48c4d769ded37e2496f97dddbbd36dc62f244b1vboxsync /* call wrapper */
c48c4d769ded37e2496f97dddbbd36dc62f244b1vboxsync AssertMsgReturn(pfnOGLWrapper[pCmd->enmOp], ("No wrapper for opcode %x\n", pCmd->enmOp), VERR_INVALID_PARAMETER);
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync AssertReturn(pCmdBuffer == pOrgBuffer + cbCmdBuffer, VERR_INVALID_PARAMETER);
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync Log(("Flush: last return value=%RX64\n", *pLastRetVal));
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync Log(("Flush: last error GL_NO_ERROR (%x)\n", GL_NO_ERROR));
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync Log(("Flush: last error GL_INVALID_ENUM (%x)\n", GL_INVALID_ENUM));
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync Log(("Flush: last error GL_INVALID_VALUE (%x)\n", GL_INVALID_VALUE));
d293c8e7a1adaf427e7a361add878676749b7da6vboxsync Log(("Flush: last error GL_INVALID_OPERATION (%x)\n", GL_INVALID_OPERATION));
73e8df2e481cb3697372a3cf4acffd068a7f1296vboxsync Log(("Flush: last error GL_STACK_OVERFLOW (%x)\n", GL_STACK_OVERFLOW));
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync Log(("Flush: last error GL_STACK_UNDERFLOW (%x)\n", GL_STACK_UNDERFLOW));
9704f1d0180960069e2c4eb8fe2ddee350910e5dvboxsync Log(("Flush: last error GL_OUT_OF_MEMORY (%x)\n", GL_OUT_OF_MEMORY));