]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - radiant/camera.h
transfer from internal tree r5311 branches/1.4-gpl
[xonotic/netradiant.git] / radiant / camera.h
1 /*\r
2 Copyright (C) 1999-2007 id Software, Inc. and contributors.\r
3 For a list of contributors, see the accompanying CONTRIBUTORS file.\r
4 \r
5 This file is part of GtkRadiant.\r
6 \r
7 GtkRadiant is free software; you can redistribute it and/or modify\r
8 it under the terms of the GNU General Public License as published by\r
9 the Free Software Foundation; either version 2 of the License, or\r
10 (at your option) any later version.\r
11 \r
12 GtkRadiant is distributed in the hope that it will be useful,\r
13 but WITHOUT ANY WARRANTY; without even the implied warranty of\r
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
15 GNU General Public License for more details.\r
16 \r
17 You should have received a copy of the GNU General Public License\r
18 along with GtkRadiant; if not, write to the Free Software\r
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
20 */\r
21 \r
22 // window system independent camera view code\r
23 \r
24 typedef enum\r
25 {\r
26   cd_wire,\r
27   cd_solid,\r
28   cd_texture,\r
29   cd_light,\r
30 //  cd_blend\r
31 } camera_draw_mode;\r
32 \r
33 #define DRAW_GL_FILL          0x0001\r
34 #define DRAW_GL_LIGHTING      0x0010\r
35 #define DRAW_GL_TEXTURE_2D    0x0100\r
36 #define DRAW_GL_BLEND         0x1000\r
37 \r
38 #define DRAW_GL_WIRE                                    0x0000\r
39 #define DRAW_GL_FLAT                                    0x0001\r
40 #define DRAW_GL_SOLID                                   0x0011\r
41 #define DRAW_GL_TEXTURED                        0x0111\r
42 \r
43 #define DRAW_WIRE                                                       0\r
44 #define DRAW_SOLID                                              1\r
45 #define DRAW_TEXTURED                                   2\r
46 \r
47 // TTimo: camera code is a huge mess\r
48 //   someone courageous should clean it up\r
49 //   this will probably happen when we have new rendering code\r
50 \r
51 #define MOVE_FORWARD      0x001\r
52 #define MOVE_BACK         0x002\r
53 #define MOVE_ROTRIGHT     0x004\r
54 #define MOVE_ROTLEFT      0x008\r
55 #define MOVE_STRAFERIGHT  0x010\r
56 #define MOVE_STRAFELEFT   0x020\r
57 \r
58 typedef struct\r
59 {\r
60   int           width, height;\r
61 \r
62   qboolean      timing;\r
63 \r
64   vec3_t        origin;\r
65   // TTimo\r
66   // indexes: PITCH = 0 YAW = 1 ROLL = 3\r
67   // AFAIK in Radiant we always have ROLL=0\r
68   vec3_t        angles;\r
69 \r
70   camera_draw_mode      draw_mode;\r
71   int draw_glstate;\r
72 \r
73   vec3_t        color;                  // background \r
74 \r
75   vec3_t  forward, right; // move matrix (TTimo: used to have up but it was not updated)\r
76   vec3_t        vup, vpn, vright;       // view matrix (taken from the GL_PROJECTION matrix)\r
77 \r
78   float projection[4][4];\r
79   float modelview[4][4];\r
80 \r
81   unsigned int movementflags;  // movement flags\r
82 \r
83 } camera_t;\r