server_framebuffer.c revision ca551aca153d6df494985b5281c573ba2e3eb474
2d2eda71267231c2526be701fe655db125852c1ffielding/* $Id$ */
f062ed7bd262a37a909dd77ce5fc23b446818823fielding
f062ed7bd262a37a909dd77ce5fc23b446818823fielding/** @file
b99dbaab171d91e1b664397cc40e039d0c087c65fielding * VBox OpenGL: EXT_framebuffer_object
f062ed7bd262a37a909dd77ce5fc23b446818823fielding */
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/*
2d2eda71267231c2526be701fe655db125852c1ffielding * Copyright (C) 2009 Sun Microsystems, Inc.
2d2eda71267231c2526be701fe655db125852c1ffielding *
2d2eda71267231c2526be701fe655db125852c1ffielding * This file is part of VirtualBox Open Source Edition (OSE), as
2d2eda71267231c2526be701fe655db125852c1ffielding * available from http://www.virtualbox.org. This file is free software;
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * you can redistribute it and/or modify it under the terms of the GNU
2d2eda71267231c2526be701fe655db125852c1ffielding * General Public License (GPL) as published by the Free Software
2d2eda71267231c2526be701fe655db125852c1ffielding * Foundation, in version 2 as it comes in the "COPYING" file of the
2d2eda71267231c2526be701fe655db125852c1ffielding * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
2d2eda71267231c2526be701fe655db125852c1ffielding * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
2d2eda71267231c2526be701fe655db125852c1ffielding *
2d2eda71267231c2526be701fe655db125852c1ffielding * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * Clara, CA 95054 USA or visit http://www.sun.com if you need
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * additional information or have any questions.
f062ed7bd262a37a909dd77ce5fc23b446818823fielding */
f062ed7bd262a37a909dd77ce5fc23b446818823fielding
f062ed7bd262a37a909dd77ce5fc23b446818823fielding#include "cr_spu.h"
f062ed7bd262a37a909dd77ce5fc23b446818823fielding#include "chromium.h"
2d2eda71267231c2526be701fe655db125852c1ffielding#include "cr_mem.h"
f062ed7bd262a37a909dd77ce5fc23b446818823fielding#include "cr_net.h"
f062ed7bd262a37a909dd77ce5fc23b446818823fielding#include "server_dispatch.h"
f062ed7bd262a37a909dd77ce5fc23b446818823fielding#include "server.h"
f062ed7bd262a37a909dd77ce5fc23b446818823fielding
2d2eda71267231c2526be701fe655db125852c1ffieldingvoid SERVER_DISPATCH_APIENTRY
f062ed7bd262a37a909dd77ce5fc23b446818823fieldingcrServerDispatchGenFramebuffersEXT(GLsizei n, GLuint *framebuffers)
f062ed7bd262a37a909dd77ce5fc23b446818823fielding{
64185f9824e42f21ca7b9ae6c004484215c031a7rbb GLuint *local_buffers = (GLuint *) crAlloc(n * sizeof(*local_buffers));
2d2eda71267231c2526be701fe655db125852c1ffielding (void) framebuffers;
f062ed7bd262a37a909dd77ce5fc23b446818823fielding cr_server.head_spu->dispatch_table.GenFramebuffersEXT(n, local_buffers);
f062ed7bd262a37a909dd77ce5fc23b446818823fielding crServerReturnValue(local_buffers, n * sizeof(*local_buffers));
f062ed7bd262a37a909dd77ce5fc23b446818823fielding crFree(local_buffers);
f062ed7bd262a37a909dd77ce5fc23b446818823fielding}
2d2eda71267231c2526be701fe655db125852c1ffielding
f062ed7bd262a37a909dd77ce5fc23b446818823fieldingvoid SERVER_DISPATCH_APIENTRY
f062ed7bd262a37a909dd77ce5fc23b446818823fieldingcrServerDispatchGenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers)
f062ed7bd262a37a909dd77ce5fc23b446818823fielding{
f062ed7bd262a37a909dd77ce5fc23b446818823fielding GLuint *local_buffers = (GLuint *) crAlloc(n * sizeof(*local_buffers));
f062ed7bd262a37a909dd77ce5fc23b446818823fielding (void) renderbuffers;
f062ed7bd262a37a909dd77ce5fc23b446818823fielding cr_server.head_spu->dispatch_table.GenFramebuffersEXT(n, local_buffers);
f062ed7bd262a37a909dd77ce5fc23b446818823fielding crServerReturnValue(local_buffers, n * sizeof(*local_buffers));
2d2eda71267231c2526be701fe655db125852c1ffielding crFree(local_buffers);
2d2eda71267231c2526be701fe655db125852c1ffielding}
2d2eda71267231c2526be701fe655db125852c1ffielding
f062ed7bd262a37a909dd77ce5fc23b446818823fieldingvoid SERVER_DISPATCH_APIENTRY crServerDispatchFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
f062ed7bd262a37a909dd77ce5fc23b446818823fielding{
f062ed7bd262a37a909dd77ce5fc23b446818823fielding if (texture)
2d2eda71267231c2526be701fe655db125852c1ffielding {
f062ed7bd262a37a909dd77ce5fc23b446818823fielding texture = crServerTranslateTextureID(texture);
f062ed7bd262a37a909dd77ce5fc23b446818823fielding }
f062ed7bd262a37a909dd77ce5fc23b446818823fielding
2d2eda71267231c2526be701fe655db125852c1ffielding crStateFramebufferTexture1DEXT(target, attachment, textarget, texture, level);
2d2eda71267231c2526be701fe655db125852c1ffielding cr_server.head_spu->dispatch_table.FramebufferTexture1DEXT(target, attachment, textarget, texture, level);
2d2eda71267231c2526be701fe655db125852c1ffielding}
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffieldingvoid SERVER_DISPATCH_APIENTRY crServerDispatchFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
b980ad7fdc218b4855cde9f75a747527f50c554dwrowe{
a253b0b3e7a5a72e32c0571a2faf336a5f5f54barbb if (texture)
fd0edaa8e3d4dd67d0604ccef2e96b071db96643fielding {
2d2eda71267231c2526be701fe655db125852c1ffielding texture = crServerTranslateTextureID(texture);
2d2eda71267231c2526be701fe655db125852c1ffielding }
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding crStateFramebufferTexture2DEXT(target, attachment, textarget, texture, level);
1df03415662628022001b7433f4bcbd3b74ebc65rbb cr_server.head_spu->dispatch_table.FramebufferTexture2DEXT(target, attachment, textarget, texture, level);
46a46ab2b6365b60b2e8e22fcceac27781745de2ben}
46a46ab2b6365b60b2e8e22fcceac27781745de2ben
1df03415662628022001b7433f4bcbd3b74ebc65rbbvoid SERVER_DISPATCH_APIENTRY crServerDispatchFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
1df03415662628022001b7433f4bcbd3b74ebc65rbb{
2d2eda71267231c2526be701fe655db125852c1ffielding if (texture)
2d2eda71267231c2526be701fe655db125852c1ffielding {
2d2eda71267231c2526be701fe655db125852c1ffielding texture = crServerTranslateTextureID(texture);
2d2eda71267231c2526be701fe655db125852c1ffielding }
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding crStateFramebufferTexture3DEXT(target, attachment, textarget, texture, level, zoffset);
1df03415662628022001b7433f4bcbd3b74ebc65rbb cr_server.head_spu->dispatch_table.FramebufferTexture3DEXT(target, attachment, textarget, texture, level, zoffset);
1df03415662628022001b7433f4bcbd3b74ebc65rbb}
46a46ab2b6365b60b2e8e22fcceac27781745de2ben