4 * Copyright (C) 2004-2011 Simon Wunderlich <dotslash@packetmixer.de>
6 * This file is part of s3d, a 3d network display server.
7 * See http://s3d.berlios.de/ for more updates.
9 * s3d is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * s3d is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with s3d; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 /* this defines the protocol */
26 /* simply put, a command can be issued from either the client or */
27 /* the server. of course, the client's command-set should be kept */
28 /* as low as possible to keep the library added to the client's code */
31 /* S3D_P_(C=Client,S=Server)_(command) */
32 /* C/S defines if who can invoke the command */
34 /* every command is 1 byte long, arguments differ. */
35 #define S3D_P_C_INIT 1
37 #define S3D_P_C_QUIT 2 /* no argument */
39 #define S3D_P_C_NEW_OBJ 3 /* add a new object */
40 /* return: 4b: object id */
41 #define S3D_P_C_DEL_OBJ 4
43 #define S3D_P_C_CLONE 5
45 /* return: 4b: object id */
49 #define S3D_P_C_LINK 6
51 /* 4b: oid (for unlink) */
55 #define S3D_P_C_PUSH_LINE 7
57 /* n*3d from vertex, to vertex, color */
58 #define S3D_P_C_PUSH_VERTEX 8
60 /* n*3f: vertexes, each with x,y,z in float */
61 #define S3D_P_C_PUSH_MAT 9
63 /* 3*4f: material elements [amb,spec,diff with r,g,b,a] */
64 #define S3D_P_C_PUSH_POLY 10
66 #define S3D_P_C_PUSH_TEX 11
68 /* nx(2x2b): width,height */
69 #define S3D_P_C_DEL_VERTEX 12
72 #define S3D_P_C_DEL_POLY 13
75 #define S3D_P_C_DEL_MAT 14
78 #define S3D_P_C_DEL_TEX 15
81 #define S3D_P_C_PEP_POLY_NORMAL 16
83 /* n*9f: normals (3* x/y/z for each vertex of the poly) */
84 #define S3D_P_C_PEP_POLY_TEXC 17
86 /* n*6f poly texture coordinates (3* u/v for each vertex of the poly) */
87 #define S3D_P_C_PEP_MAT 18
89 /* 3*4f: material elements [amb,spec,diff with r,g,b,a] */
90 #define S3D_P_C_PEP_MAT_TEX 19
92 /* 4b: texture index references */
93 #define S3D_P_C_PEP_VERTEX 20
95 /* n*3f: vertexes, each with x,y,z in float */
96 #define S3D_P_C_PEP_LINE 21
98 /* n*3u: line information (from,to,color)*/
99 #define S3D_P_C_DEL_LINE 22
102 #define S3D_P_C_PEP_LINE_NORMAL 23
104 /* n*6f: normals (2* x/y/z for each vertex of the line) */
105 #define S3D_P_C_LOAD_POLY_NORMAL 24
108 /* n*9f: normals (3* x/y/z for each vertex of the poly) */
109 #define S3D_P_C_LOAD_POLY_TEXC 25
112 /* n*6f poly texture coordinates (3* u/v for each vertex of the poly) */
113 #define S3D_P_C_LOAD_MAT 26
116 /* 3*4f: material elements [amb,spec,diff with r,g,b,a] */
117 #define S3D_P_C_UPDATE_TEX 29
120 /* 4*2b: xpos,ypos,width,height */
121 #define S3D_P_C_LOAD_TEX 28
123 /* 4b: texture number */
124 /* 4*2b: xpos,ypos,width,height */
125 /* n*2b: pixbuf (16bit) */
126 #define S3D_P_C_LOAD_MAT_TEX 29
128 /* 4b: texture index references */
129 #define S3D_P_C_LOAD_LINE_NORMAL 30
132 /* n*6f: normals (2* x/y/z for each vertex of the line) */
134 #define S3D_P_C_TOGGLE_FLAGS 32
138 #define S3D_P_C_TRANSLATE 33
141 #define S3D_P_C_ROTATE 34
143 /* 3f: rotation angle over x,y,z axis */
144 #define S3D_P_C_SCALE 35
147 #define S3D_P_C_GET_SIZE 36
149 #define S3D_P_MCP_FOCUS 66 /* set the app which should get the keystrokes etc */
150 /* 4b: object id/pid */
154 #define S3D_P_MCP_OBJECT 67
159 #define S3D_P_MCP_DEL_OBJECT 68
161 #define S3D_P_S_INIT 1
162 /* 1b: acknowledged */
163 /* 3b: version,major,minor */
164 /* description string */
165 #define S3D_P_S_QUIT 2
166 #define S3D_P_S_CLICK 3
168 #define S3D_P_S_KEY 4
170 /* 2b: unicode translation */
171 /* 2b: modifier information */
173 #define S3D_P_S_MBUTTON 5
174 /* 1b: button number */
175 /* 2b: button state */
176 #define S3D_P_S_SHMTEX 6
178 /* 4b: texture number */
180 /* 4*2b: width, height, bufwidth, bufheight */
181 #define S3D_P_S_NEWOBJ 16
184 #define S3D_P_S_OINFO 32