1 | /** @file
|
---|
2 | * VBox Packing VisibleRegion information
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2008 Oracle Corporation
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | */
|
---|
16 |
|
---|
17 | #include "packer.h"
|
---|
18 | #include "cr_opcodes.h"
|
---|
19 | #include "cr_error.h"
|
---|
20 |
|
---|
21 | #ifdef WINDOWS
|
---|
22 | #include <windows.h>
|
---|
23 | #endif
|
---|
24 |
|
---|
25 | void PACK_APIENTRY crPackWindowVisibleRegion( GLint window, GLint cRects, GLint * pRects )
|
---|
26 | {
|
---|
27 | GLint i, size, cnt;
|
---|
28 |
|
---|
29 | CR_GET_PACKER_CONTEXT(pc);
|
---|
30 | unsigned char *data_ptr;
|
---|
31 | (void) pc;
|
---|
32 | size = 16 + cRects * 4 * sizeof(GLint);
|
---|
33 | CR_GET_BUFFERED_POINTER( pc, size );
|
---|
34 | WRITE_DATA( 0, GLint, size );
|
---|
35 | WRITE_DATA( 4, GLenum, CR_WINDOWVISIBLEREGION_EXTEND_OPCODE );
|
---|
36 | WRITE_DATA( 8, GLint, window );
|
---|
37 | WRITE_DATA( 12, GLint, cRects );
|
---|
38 |
|
---|
39 | cnt = 16;
|
---|
40 | for (i=0; i<cRects; ++i)
|
---|
41 | {
|
---|
42 | WRITE_DATA(cnt, GLint, (GLint) pRects[4*i+0]);
|
---|
43 | WRITE_DATA(cnt+4, GLint, (GLint) pRects[4*i+1]);
|
---|
44 | WRITE_DATA(cnt+8, GLint, (GLint) pRects[4*i+2]);
|
---|
45 | WRITE_DATA(cnt+12, GLint, (GLint) pRects[4*i+3]);
|
---|
46 | cnt += 16;
|
---|
47 | }
|
---|
48 | WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
|
---|
49 | CR_UNLOCK_PACKER_CONTEXT(pc);
|
---|
50 | }
|
---|
51 |
|
---|
52 | void PACK_APIENTRY crPackWindowVisibleRegionSWAP( GLint window, GLint cRects, GLint * pRects )
|
---|
53 | {
|
---|
54 | crError( "crPackWindowVisibleRegionSWAP unimplemented and shouldn't be called" );
|
---|
55 | }
|
---|