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_IDGLWIDGET_H__6399A341_2976_4A6E_87DD_9AF4DBD4C5DB__INCLUDED_)
29 #define AFX_IDGLWIDGET_H__6399A341_2976_4A6E_87DD_9AF4DBD4C5DB__INCLUDED_
33 #endif // _MSC_VER > 1000
35 /////////////////////////////////////////////////////////////////////////////
42 virtual void draw(int x, int y, int w, int h);
43 virtual void setMedia(const char *name){}
44 virtual void buttonDown(int button, float x, float y);
45 virtual void buttonUp(int button, float x, float y);
46 virtual void mouseMove(float x, float y);
47 virtual int getRealTime() {return realTime;};
48 virtual bool ScreenCoords() {
51 void SetRealTime(int i) {
54 virtual void Update() {};
58 void setScale(float f) {
73 class idGLDrawableWorld : public idGLDrawable {
77 void AddTris(srfTriangles_t *tris, const idMaterial *mat);
78 virtual void draw(int x, int y, int w, int h);
82 idRenderModel *worldModel;
83 qhandle_t worldModelDef;
88 class idGLDrawableMaterial : public idGLDrawableWorld {
91 idGLDrawableMaterial(const idMaterial *mat) {
98 idGLDrawableMaterial() {
105 ~idGLDrawableMaterial() {
108 virtual void setMedia(const char *name);
109 virtual void draw(int x, int y, int w, int h);
110 virtual void buttonUp(int button){}
111 virtual void buttonDown(int button, float x, float y);
112 virtual void mouseMove(float x, float y);
113 virtual void Update() { worldDirty = true ;};
116 const idMaterial *material;
121 class idGLDrawableModel : public idGLDrawableWorld {
124 idGLDrawableModel(const char *name);
128 ~idGLDrawableModel() {}
130 virtual void setMedia(const char *name);
132 virtual void buttonDown(int button, float x, float y);
133 virtual void mouseMove(float x, float y);
134 virtual void draw(int x, int y, int w, int h);
135 virtual void Update() { worldDirty = true ;};
136 virtual bool ScreenCoords() {
139 void SetSkin( const char *skin );
152 class idGLDrawableConsole : public idGLDrawable {
155 idGLDrawableConsole () {
158 ~idGLDrawableConsole() {
161 virtual void setMedia(const char *name) {
165 virtual void draw(int x, int y, int w, int h);
167 virtual int getRealTime() {return 0;};
175 class idGLWidget : public CWnd
180 void setDrawable(idGLDrawable *d);
189 // ClassWizard generated virtual function overrides
190 //{{AFX_VIRTUAL(idGLWidget)
192 virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
194 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
199 virtual ~idGLWidget();
201 // Generated message map functions
203 idGLDrawable *drawable;
205 //{{AFX_MSG(idGLWidget)
206 afx_msg void OnPaint();
207 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
208 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
209 afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
210 afx_msg void OnMButtonUp(UINT nFlags, CPoint point);
211 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
212 afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
213 afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
214 afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
215 afx_msg void OnTimer(UINT nIDEvent);
216 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
219 DECLARE_MESSAGE_MAP()
222 class idGLConsoleWidget : public idGLWidget {
223 idGLDrawableConsole console;
225 idGLConsoleWidget() {
227 ~idGLConsoleWidget() {
231 //{{AFX_MSG(idGLConsoleWidget)
232 afx_msg void OnPaint();
233 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
234 afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
235 afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
236 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
238 DECLARE_MESSAGE_MAP()
242 /////////////////////////////////////////////////////////////////////////////
244 //{{AFX_INSERT_LOCATION}}
245 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
247 #endif // !defined(AFX_IDGLWIDGET_H__6399A341_2976_4A6E_87DD_9AF4DBD4C5DB__INCLUDED_)