1 | /* $Id: server_framebuffer.c 31808 2010-08-20 09:40:40Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | * VBox OpenGL: EXT_framebuffer_object
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2009 Oracle Corporation
|
---|
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 |
|
---|
19 | #include "cr_spu.h"
|
---|
20 | #include "chromium.h"
|
---|
21 | #include "cr_mem.h"
|
---|
22 | #include "cr_net.h"
|
---|
23 | #include "server_dispatch.h"
|
---|
24 | #include "server.h"
|
---|
25 |
|
---|
26 | void SERVER_DISPATCH_APIENTRY
|
---|
27 | crServerDispatchGenFramebuffersEXT(GLsizei n, GLuint *framebuffers)
|
---|
28 | {
|
---|
29 | GLuint *local_buffers = (GLuint *) crAlloc(n * sizeof(*local_buffers));
|
---|
30 | (void) framebuffers;
|
---|
31 | cr_server.head_spu->dispatch_table.GenFramebuffersEXT(n, local_buffers);
|
---|
32 | crServerReturnValue(local_buffers, n * sizeof(*local_buffers));
|
---|
33 | crFree(local_buffers);
|
---|
34 | }
|
---|
35 |
|
---|
36 | void SERVER_DISPATCH_APIENTRY
|
---|
37 | crServerDispatchGenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers)
|
---|
38 | {
|
---|
39 | GLuint *local_buffers = (GLuint *) crAlloc(n * sizeof(*local_buffers));
|
---|
40 | (void) renderbuffers;
|
---|
41 | cr_server.head_spu->dispatch_table.GenFramebuffersEXT(n, local_buffers);
|
---|
42 | crServerReturnValue(local_buffers, n * sizeof(*local_buffers));
|
---|
43 | crFree(local_buffers);
|
---|
44 | }
|
---|
45 |
|
---|
46 | void SERVER_DISPATCH_APIENTRY crServerDispatchFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
|
---|
47 | {
|
---|
48 | crStateFramebufferTexture1DEXT(target, attachment, textarget, texture, level);
|
---|
49 | cr_server.head_spu->dispatch_table.FramebufferTexture1DEXT(target, attachment, textarget, crStateGetTextureHWID(texture), level);
|
---|
50 | }
|
---|
51 |
|
---|
52 | void SERVER_DISPATCH_APIENTRY crServerDispatchFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
|
---|
53 | {
|
---|
54 | crStateFramebufferTexture2DEXT(target, attachment, textarget, texture, level);
|
---|
55 | cr_server.head_spu->dispatch_table.FramebufferTexture2DEXT(target, attachment, textarget, crStateGetTextureHWID(texture), level);
|
---|
56 | }
|
---|
57 |
|
---|
58 | void SERVER_DISPATCH_APIENTRY crServerDispatchFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
|
---|
59 | {
|
---|
60 | crStateFramebufferTexture3DEXT(target, attachment, textarget, texture, level, zoffset);
|
---|
61 | cr_server.head_spu->dispatch_table.FramebufferTexture3DEXT(target, attachment, textarget, crStateGetTextureHWID(texture), level, zoffset);
|
---|
62 | }
|
---|
63 |
|
---|
64 | void SERVER_DISPATCH_APIENTRY crServerDispatchBindFramebufferEXT(GLenum target, GLuint framebuffer)
|
---|
65 | {
|
---|
66 | crStateBindFramebufferEXT(target, framebuffer);
|
---|
67 |
|
---|
68 | if (0==framebuffer && crServerIsRedirectedToFBO())
|
---|
69 | {
|
---|
70 | cr_server.head_spu->dispatch_table.BindFramebufferEXT(target, cr_server.curClient->currentMural->idFBO);
|
---|
71 | }
|
---|
72 | else
|
---|
73 | {
|
---|
74 | cr_server.head_spu->dispatch_table.BindFramebufferEXT(target, crStateGetFramebufferHWID(framebuffer));
|
---|
75 | }
|
---|
76 | }
|
---|
77 |
|
---|
78 | void SERVER_DISPATCH_APIENTRY crServerDispatchBindRenderbufferEXT(GLenum target, GLuint renderbuffer)
|
---|
79 | {
|
---|
80 | crStateBindRenderbufferEXT(target, renderbuffer);
|
---|
81 | cr_server.head_spu->dispatch_table.BindRenderbufferEXT(target, crStateGetRenderbufferHWID(renderbuffer));
|
---|
82 | }
|
---|
83 |
|
---|
84 | void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers)
|
---|
85 | {
|
---|
86 | crStateDeleteFramebuffersEXT(n, framebuffers);
|
---|
87 | }
|
---|
88 |
|
---|
89 | void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers)
|
---|
90 | {
|
---|
91 | crStateDeleteRenderbuffersEXT(n, renderbuffers);
|
---|
92 | }
|
---|
93 |
|
---|
94 | void SERVER_DISPATCH_APIENTRY
|
---|
95 | crServerDispatchFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
|
---|
96 | {
|
---|
97 | crStateFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer);
|
---|
98 | cr_server.head_spu->dispatch_table.FramebufferRenderbufferEXT(target, attachment, renderbuffertarget, crStateGetRenderbufferHWID(renderbuffer));
|
---|
99 | }
|
---|
100 |
|
---|
101 | void SERVER_DISPATCH_APIENTRY
|
---|
102 | crServerDispatchGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint * params)
|
---|
103 | {
|
---|
104 | GLint local_params[1];
|
---|
105 | (void) params;
|
---|
106 | crStateGetFramebufferAttachmentParameterivEXT(target, attachment, pname, local_params);
|
---|
107 |
|
---|
108 | crServerReturnValue(&(local_params[0]), 1*sizeof(GLint));
|
---|
109 | }
|
---|
110 |
|
---|
111 | GLboolean SERVER_DISPATCH_APIENTRY crServerDispatchIsFramebufferEXT( GLuint framebuffer )
|
---|
112 | {
|
---|
113 | GLboolean retval;
|
---|
114 | retval = cr_server.head_spu->dispatch_table.IsFramebufferEXT(crStateGetFramebufferHWID(framebuffer));
|
---|
115 | crServerReturnValue( &retval, sizeof(retval) );
|
---|
116 | return retval; /* WILL PROBABLY BE IGNORED */
|
---|
117 | }
|
---|
118 |
|
---|
119 | GLboolean SERVER_DISPATCH_APIENTRY crServerDispatchIsRenderbufferEXT( GLuint renderbuffer )
|
---|
120 | {
|
---|
121 | GLboolean retval;
|
---|
122 | retval = cr_server.head_spu->dispatch_table.IsRenderbufferEXT(crStateGetRenderbufferHWID(renderbuffer));
|
---|
123 | crServerReturnValue( &retval, sizeof(retval) );
|
---|
124 | return retval; /* WILL PROBABLY BE IGNORED */
|
---|
125 | }
|
---|