1 | /* $Id: pack_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 "packer.h"
|
---|
24 | #include "cr_error.h"
|
---|
25 | #include "cr_string.h"
|
---|
26 |
|
---|
27 | void PACK_APIENTRY
|
---|
28 | crPackDeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers)
|
---|
29 | {
|
---|
30 | unsigned char *data_ptr;
|
---|
31 | int packet_length = sizeof(GLenum) + sizeof(n) + n*sizeof(*renderbuffers);
|
---|
32 |
|
---|
33 | if (!renderbuffers)
|
---|
34 | return;
|
---|
35 |
|
---|
36 | data_ptr = (unsigned char *) crPackAlloc(packet_length);
|
---|
37 | WRITE_DATA(0, GLenum, CR_DELETERENDERBUFFERSEXT_EXTEND_OPCODE);
|
---|
38 | WRITE_DATA(4, GLsizei, n);
|
---|
39 | crMemcpy(data_ptr + 8, renderbuffers, n* sizeof(*renderbuffers));
|
---|
40 | crHugePacket(CR_EXTEND_OPCODE, data_ptr);
|
---|
41 | crPackFree(data_ptr);
|
---|
42 | }
|
---|
43 |
|
---|
44 | void PACK_APIENTRY
|
---|
45 | crPackDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers)
|
---|
46 | {
|
---|
47 | unsigned char *data_ptr;
|
---|
48 | int packet_length = sizeof(GLenum) + sizeof(n) + n*sizeof(*framebuffers);
|
---|
49 |
|
---|
50 | if (!framebuffers)
|
---|
51 | return;
|
---|
52 |
|
---|
53 | data_ptr = (unsigned char *) crPackAlloc(packet_length);
|
---|
54 | WRITE_DATA(0, GLenum, CR_DELETERENDERBUFFERSEXT_EXTEND_OPCODE);
|
---|
55 | WRITE_DATA(4, GLsizei, n);
|
---|
56 | crMemcpy(data_ptr + 8, framebuffers, n* sizeof(*framebuffers));
|
---|
57 | crHugePacket(CR_EXTEND_OPCODE, data_ptr);
|
---|
58 | crPackFree(data_ptr);
|
---|
59 | }
|
---|
60 |
|
---|
61 | void PACK_APIENTRY
|
---|
62 | crPackDeleteRenderbuffersEXTSWAP(GLsizei n, const GLuint * renderbuffers)
|
---|
63 | {
|
---|
64 | (void) n;
|
---|
65 | (void) renderbuffers;
|
---|
66 | crError ("No swap version");
|
---|
67 | }
|
---|
68 |
|
---|
69 | void PACK_APIENTRY
|
---|
70 | crPackDeleteFramebuffersEXTSWAP(GLsizei n, const GLuint * framebuffers)
|
---|
71 | {
|
---|
72 | (void) n;
|
---|
73 | (void) framebuffers;
|
---|
74 | crError ("No swap version");
|
---|
75 | }
|
---|