1 | /* $Id: server_framebuffer.c 22155 2009-08-11 10:36:56Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | * VBox OpenGL: EXT_framebuffer_object
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2009 Sun Microsystems, Inc.
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #include "cr_spu.h"
|
---|
24 | #include "chromium.h"
|
---|
25 | #include "cr_mem.h"
|
---|
26 | #include "cr_net.h"
|
---|
27 | #include "server_dispatch.h"
|
---|
28 | #include "server.h"
|
---|
29 |
|
---|
30 | void SERVER_DISPATCH_APIENTRY
|
---|
31 | crServerDispatchGenFramebuffersEXT(GLsizei n, GLuint *framebuffers)
|
---|
32 | {
|
---|
33 | GLuint *local_buffers = (GLuint *) crAlloc(n * sizeof(*local_buffers));
|
---|
34 | (void) framebuffers;
|
---|
35 | cr_server.head_spu->dispatch_table.GenFramebuffersEXT(n, local_buffers);
|
---|
36 | crServerReturnValue(local_buffers, n * sizeof(*local_buffers));
|
---|
37 | crFree(local_buffers);
|
---|
38 | }
|
---|
39 |
|
---|
40 | void SERVER_DISPATCH_APIENTRY
|
---|
41 | crServerDispatchGenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers)
|
---|
42 | {
|
---|
43 | GLuint *local_buffers = (GLuint *) crAlloc(n * sizeof(*local_buffers));
|
---|
44 | (void) renderbuffers;
|
---|
45 | cr_server.head_spu->dispatch_table.GenFramebuffersEXT(n, local_buffers);
|
---|
46 | crServerReturnValue(local_buffers, n * sizeof(*local_buffers));
|
---|
47 | crFree(local_buffers);
|
---|
48 | }
|
---|
49 |
|
---|
50 | void SERVER_DISPATCH_APIENTRY crServerDispatchFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
|
---|
51 | {
|
---|
52 | if (texture)
|
---|
53 | {
|
---|
54 | texture = crServerTranslateTextureID(texture);
|
---|
55 | }
|
---|
56 |
|
---|
57 | crStateFramebufferTexture1DEXT(target, attachment, textarget, texture, level);
|
---|
58 | cr_server.head_spu->dispatch_table.FramebufferTexture1DEXT(target, attachment, textarget, texture, level);
|
---|
59 | }
|
---|
60 |
|
---|
61 | void SERVER_DISPATCH_APIENTRY crServerDispatchFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
|
---|
62 | {
|
---|
63 | if (texture)
|
---|
64 | {
|
---|
65 | texture = crServerTranslateTextureID(texture);
|
---|
66 | }
|
---|
67 |
|
---|
68 | crStateFramebufferTexture2DEXT(target, attachment, textarget, texture, level);
|
---|
69 | cr_server.head_spu->dispatch_table.FramebufferTexture2DEXT(target, attachment, textarget, texture, level);
|
---|
70 | }
|
---|
71 |
|
---|
72 | void SERVER_DISPATCH_APIENTRY crServerDispatchFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
|
---|
73 | {
|
---|
74 | if (texture)
|
---|
75 | {
|
---|
76 | texture = crServerTranslateTextureID(texture);
|
---|
77 | }
|
---|
78 |
|
---|
79 | crStateFramebufferTexture3DEXT(target, attachment, textarget, texture, level, zoffset);
|
---|
80 | cr_server.head_spu->dispatch_table.FramebufferTexture3DEXT(target, attachment, textarget, texture, level, zoffset);
|
---|
81 | }
|
---|