1 | /* $Id: pack_framebuffer.c 69500 2017-10-28 15:14:05Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | * VBox OpenGL: EXT_framebuffer_object
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2009-2017 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 "packer.h"
|
---|
20 | #include "cr_error.h"
|
---|
21 | #include "cr_string.h"
|
---|
22 |
|
---|
23 | void PACK_APIENTRY
|
---|
24 | crPackDeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers)
|
---|
25 | {
|
---|
26 | unsigned char *data_ptr;
|
---|
27 | int packet_length = sizeof(GLenum) + sizeof(n) + n*sizeof(*renderbuffers);
|
---|
28 |
|
---|
29 | if (!renderbuffers)
|
---|
30 | return;
|
---|
31 |
|
---|
32 | data_ptr = (unsigned char *) crPackAlloc(packet_length);
|
---|
33 | WRITE_DATA(0, GLenum, CR_DELETERENDERBUFFERSEXT_EXTEND_OPCODE);
|
---|
34 | WRITE_DATA(4, GLsizei, n);
|
---|
35 | crMemcpy(data_ptr + 8, renderbuffers, n* sizeof(*renderbuffers));
|
---|
36 | crHugePacket(CR_EXTEND_OPCODE, data_ptr);
|
---|
37 | crPackFree(data_ptr);
|
---|
38 | }
|
---|
39 |
|
---|
40 | void PACK_APIENTRY
|
---|
41 | crPackDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers)
|
---|
42 | {
|
---|
43 | unsigned char *data_ptr;
|
---|
44 | int packet_length = sizeof(GLenum) + sizeof(n) + n*sizeof(*framebuffers);
|
---|
45 |
|
---|
46 | if (!framebuffers)
|
---|
47 | return;
|
---|
48 |
|
---|
49 | data_ptr = (unsigned char *) crPackAlloc(packet_length);
|
---|
50 | WRITE_DATA(0, GLenum, CR_DELETEFRAMEBUFFERSEXT_EXTEND_OPCODE);
|
---|
51 | WRITE_DATA(4, GLsizei, n);
|
---|
52 | crMemcpy(data_ptr + 8, framebuffers, n* sizeof(*framebuffers));
|
---|
53 | crHugePacket(CR_EXTEND_OPCODE, data_ptr);
|
---|
54 | crPackFree(data_ptr);
|
---|
55 | }
|
---|
56 |
|
---|
57 | void PACK_APIENTRY
|
---|
58 | crPackDeleteRenderbuffersEXTSWAP(GLsizei n, const GLuint * renderbuffers)
|
---|
59 | {
|
---|
60 | (void) n;
|
---|
61 | (void) renderbuffers;
|
---|
62 | crError ("No swap version");
|
---|
63 | }
|
---|
64 |
|
---|
65 | void PACK_APIENTRY
|
---|
66 | crPackDeleteFramebuffersEXTSWAP(GLsizei n, const GLuint * framebuffers)
|
---|
67 | {
|
---|
68 | (void) n;
|
---|
69 | (void) framebuffers;
|
---|
70 | crError ("No swap version");
|
---|
71 | }
|
---|