VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_framebuffer.c@ 33281

Last change on this file since 33281 was 31808, checked in by vboxsync, 14 years ago

crOpenGL: resource sharing between contexts

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.0 KB
Line 
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
26void SERVER_DISPATCH_APIENTRY
27crServerDispatchGenFramebuffersEXT(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
36void SERVER_DISPATCH_APIENTRY
37crServerDispatchGenRenderbuffersEXT(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
46void 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
52void 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
58void 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
64void 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
78void 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
84void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers)
85{
86 crStateDeleteFramebuffersEXT(n, framebuffers);
87}
88
89void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers)
90{
91 crStateDeleteRenderbuffersEXT(n, renderbuffers);
92}
93
94void SERVER_DISPATCH_APIENTRY
95crServerDispatchFramebufferRenderbufferEXT(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
101void SERVER_DISPATCH_APIENTRY
102crServerDispatchGetFramebufferAttachmentParameterivEXT(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
111GLboolean 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
119GLboolean 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}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette