VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/include/cr_protocol.h@ 17108

Last change on this file since 17108 was 15532, checked in by vboxsync, 16 years ago

crOpenGL: export to OSE

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.3 KB
Line 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved.
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7#ifndef CR_PROTOCOL_H
8#define CR_PROTOCOL_H
9
10#include <iprt/cdefs.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16typedef enum {
17 /* first message types is 'wGL\001', so we can immediately
18 recognize bad message types */
19 CR_MESSAGE_OPCODES = 0x77474c01,
20 CR_MESSAGE_WRITEBACK,
21 CR_MESSAGE_READBACK,
22 CR_MESSAGE_READ_PIXELS,
23 CR_MESSAGE_MULTI_BODY,
24 CR_MESSAGE_MULTI_TAIL,
25 CR_MESSAGE_FLOW_CONTROL,
26 CR_MESSAGE_OOB,
27 CR_MESSAGE_NEWCLIENT,
28 CR_MESSAGE_GATHER,
29 CR_MESSAGE_ERROR,
30 CR_MESSAGE_CRUT,
31 CR_MESSAGE_REDIR_PTR
32} CRMessageType;
33
34typedef union {
35 /* pointers are usually 4 bytes, but on 64-bit machines (Alpha,
36 * SGI-n64, etc.) they are 8 bytes. Pass network pointers around
37 * as an opaque array of bytes, since the interpretation & size of
38 * the pointer only matter to the machine which emitted the
39 * pointer (and will eventually receive the pointer back again) */
40 unsigned int ptrAlign[2];
41 unsigned char ptrSize[8];
42 /* hack to make this packet big */
43 /* unsigned int junk[512]; */
44} CRNetworkPointer;
45
46typedef struct {
47 CRMessageType type;
48 unsigned int conn_id;
49} CRMessageHeader;
50
51typedef struct CRMessageOpcodes {
52 CRMessageHeader header;
53 unsigned int numOpcodes;
54} CRMessageOpcodes;
55
56typedef struct CRMessageRedirPtr {
57 CRMessageHeader header;
58 CRMessageHeader* pMessage;
59} CRMessageRedirPtr;
60
61typedef struct CRMessageWriteback {
62 CRMessageHeader header;
63 CRNetworkPointer writeback_ptr;
64} CRMessageWriteback;
65
66typedef struct CRMessageReadback {
67 CRMessageHeader header;
68 CRNetworkPointer writeback_ptr;
69 CRNetworkPointer readback_ptr;
70} CRMessageReadback;
71
72typedef struct CRMessageMulti {
73 CRMessageHeader header;
74} CRMessageMulti;
75
76typedef struct CRMessageFlowControl {
77 CRMessageHeader header;
78 unsigned int credits;
79} CRMessageFlowControl;
80
81typedef struct CRMessageReadPixels {
82 CRMessageHeader header;
83 int width, height;
84 unsigned int bytes_per_row;
85 unsigned int stride;
86 int alignment;
87 int skipRows;
88 int skipPixels;
89 int rowLength;
90 int format;
91 int type;
92 CRNetworkPointer pixels;
93} CRMessageReadPixels;
94
95typedef struct CRMessageNewClient {
96 CRMessageHeader header;
97} CRMessageNewClient;
98
99typedef struct CRMessageGather {
100 CRMessageHeader header;
101 unsigned long offset;
102 unsigned long len;
103} CRMessageGather;
104
105typedef union {
106 CRMessageHeader header;
107 CRMessageOpcodes opcodes;
108 CRMessageRedirPtr redirptr;
109 CRMessageWriteback writeback;
110 CRMessageReadback readback;
111 CRMessageReadPixels readPixels;
112 CRMessageMulti multi;
113 CRMessageFlowControl flowControl;
114 CRMessageNewClient newclient;
115 CRMessageGather gather;
116} CRMessage;
117
118DECLEXPORT(void) crNetworkPointerWrite( CRNetworkPointer *dst, void *src );
119
120#ifdef __cplusplus
121}
122#endif
123
124#endif /* CR_PROTOCOL_H */
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