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