2 ===========================================================================
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
9 Doom 3 Source Code 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 3 of the License, or
12 (at your option) any later version.
14 Doom 3 Source Code 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 Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
26 ===========================================================================
28 #if !defined(AFX_CAMWND_H__44B4BA03_781B_11D1_B53C_00AA00A410FC__INCLUDED_)
29 #define AFX_CAMWND_H__44B4BA03_781B_11D1_B53C_00AA00A410FC__INCLUDED_
33 #endif // _MSC_VER >= 1000
51 camera_draw_mode draw_mode;
53 idVec3 color; // background
55 idVec3 forward, right, up; // move matrix
56 idVec3 vup, vpn, vright; // view matrix
60 /////////////////////////////////////////////////////////////////////////////
64 class CCamWnd : public CWnd
66 DECLARE_DYNCREATE(CCamWnd);
78 // ClassWizard generated virtual function overrides
79 //{{AFX_VIRTUAL(CCamWnd)
81 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
86 void ShiftTexture_BrushPrimit(face_t *f, int x, int y);
88 void SetXYFriend(CXYWnd* pWnd);
90 camera_t& Camera(){return m_Camera;};
91 void Cam_MouseControl(float dtime);
92 void Cam_ChangeFloor(bool up);
93 void BuildRendererState();
94 void ToggleRenderMode();
95 void ToggleRebuildMode();
96 void ToggleEntityMode();
97 void ToggleSelectMode();
98 void ToggleAnimationMode();
99 void ToggleSoundMode();
100 void SetProjectionMatrix();
101 void UpdateCameraView();
103 void BuildEntityRenderState( entity_t *ent, bool update );
104 bool GetRenderMode() {
107 bool GetRebuildMode() {
110 bool GetEntityMode() {
113 bool GetAnimationMode() {
114 return animationMode;
116 bool GetSelectMode() {
119 bool GetSoundMode() {
124 bool UpdateRenderEntities();
125 void MarkWorldDirty();
127 void SetView( const idVec3 &origin, const idAngles &angles ) {
128 m_Camera.origin = origin;
129 m_Camera.angles = angles;
134 void Cam_BuildMatrix();
135 void Cam_PositionDrag();
136 void Cam_MouseLook();
137 void Cam_MouseDown(int x, int y, int buttons);
138 void Cam_MouseUp (int x, int y, int buttons);
139 void Cam_MouseMoved (int x, int y, int buttons);
141 bool CullBrush (brush_t *b, bool cubicOnly);
145 // game renderer interaction
146 qhandle_t worldModelDef;
147 idRenderModel *worldModel; // createRawModel of the brush and patch geometry
155 void FreeRendererState();
156 void UpdateCaption();
157 bool BuildBrushRenderData(brush_t *brush);
158 void DrawEntityData();
162 int m_nCambuttonstate;
165 CPoint m_ptLastCursor;
166 face_t* m_pSide_select;
176 // Generated message map functions
178 void OriginalMouseDown(UINT nFlags, CPoint point);
179 void OriginalMouseUp(UINT nFlags, CPoint point);
181 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
182 afx_msg void OnPaint();
183 afx_msg void OnDestroy();
184 afx_msg void OnClose();
185 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
186 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
187 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
188 afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
189 afx_msg void OnMButtonUp(UINT nFlags, CPoint point);
190 afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
191 afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
192 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
193 afx_msg void OnSize(UINT nType, int cx, int cy);
194 afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
195 afx_msg void OnTimer(UINT nIDEvent);
197 DECLARE_MESSAGE_MAP()
200 /////////////////////////////////////////////////////////////////////////////
202 //{{AFX_INSERT_LOCATION}}
203 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
205 #endif // !defined(AFX_CAMWND_H__44B4BA03_781B_11D1_B53C_00AA00A410FC__INCLUDED_)