doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MaterialPreviewView.h
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
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.
13 
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.
18 
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/>.
21 
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.
23 
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.
25 
26 ===========================================================================
27 */
28 #pragma once
29 
30 #include "MaterialView.h"
31 #include "../radiant/GLWidget.h"
32 
33 
35 
36 public:
39 
40  virtual void setMedia(const char *name);
41  virtual void draw(int x, int y, int w, int h);
42  virtual void buttonUp(int button){}
43  virtual void buttonDown(int _button, float x, float y);
44  virtual void mouseMove(float x, float y);
45  virtual void Update() {};
46 
47  void UpdateCamera( renderView_t *refdef );
48  void UpdateModel( void );
49  void UpdateLights( void );
50 
51  void addLight( void );
52  void deleteLight( const int lightId );
53  void drawLights( renderView_t *refdef );
54 
55  void InitWorld();
56  void ResetView( void );
57 
58  void setLightShader( const int lightId, const idStr shaderName );
59  void setLightColor( const int lightId, const idVec3 &value );
60  void setLightRadius( const int lightId, const float radius );
61  void setLightAllowMove( const int lightId, const bool move );
62  void setObject( int Id );
63  void setCustomModel( const idStr modelName );
64  void setShowLights( bool _showLights );
65  void setLocalParm( int parmNum, float value );
66  void setGlobalParm( int parmNum, float value );
67 
68 protected:
72 
73  bool showLights;
74 
77  float viewDistance;
78 
81 
82  int objectId;
84 
86 
87  typedef struct {
92  float radius;
94  bool allowMove;
95  } lightInfo_t;
96 
98 };
99 
100 
101 // ==================================================================
102 // ==================================================================
103 
104 class MaterialPreviewView : public CView, public MaterialView
105 {
106  DECLARE_DYNCREATE(MaterialPreviewView)
107 
108 protected:
110  virtual ~MaterialPreviewView();
111 
112 public:
113  virtual void OnDraw(CDC* pDC); // overridden to draw this view
114 
115  void MV_OnMaterialSelectionChange(MaterialDoc* pMaterial);
116 
117  void OnModelChange( int modelId );
118  void OnCustomModelChange( idStr modelName );
119  void OnShowLightsChange( bool showLights );
120 
121  void OnLocalParmChange( int parmNum, float value );
122  void OnGlobalParmChange( int parmNum, float value );
123 
124  void OnLightShaderChange( int lightId, idStr shaderName );
125  void OnLightRadiusChange( int lightId, float radius );
126  void OnLightColorChange( int lightId, idVec3 &color );
127  void OnLightAllowMoveChange( int lightId, bool move );
128 
129  void OnAddLight( void );
130  void OnDeleteLight( int lightId );
131 
132 #ifdef _DEBUG
133  virtual void AssertValid() const;
134  virtual void Dump(CDumpContext& dc) const;
135 #endif
136 
137 protected:
140 
142 
143  DECLARE_MESSAGE_MAP()
144 
145 public:
146  afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
147  afx_msg void OnSize(UINT nType, int cx, int cy);
148 };
149 
byte color[4]
Definition: MegaTexture.cpp:54
void setLightAllowMove(const int lightId, const bool move)
virtual void Update()
GLsizei const GLfloat * value
Definition: glext.h:3614
int qhandle_t
Definition: Lib.h:81
idRenderWorld * world
const int MAX_GLOBAL_SHADER_PARMS
Definition: RenderWorld.h:44
void setCustomModel(const idStr modelName)
virtual void buttonDown(int _button, float x, float y)
CONST PIXELFORMATDESCRIPTOR UINT
Definition: win_qgl.cpp:47
void OnModelChange(int modelId)
GLenum GLint GLint y
Definition: glext.h:2849
void setLightShader(const int lightId, const idStr shaderName)
void OnDeleteLight(int lightId)
void setLocalParm(int parmNum, float value)
Definition: Vector.h:316
idRenderModel * worldModel
GLenum GLint x
Definition: glext.h:2849
void drawLights(renderView_t *refdef)
void deleteLight(const int lightId)
void OnLightRadiusChange(int lightId, float radius)
Responsible for managing a single material that is being viewed and/or edited.
Definition: MaterialDoc.h:67
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:3454
void OnCustomModelChange(idStr modelName)
void OnShowLightsChange(bool showLights)
MaterialView Interface.
Definition: MaterialView.h:38
virtual void mouseMove(float x, float y)
void OnLightAllowMoveChange(int lightId, bool move)
void OnGlobalParmChange(int parmNum, float value)
void UpdateCamera(renderView_t *refdef)
virtual void buttonUp(int button)
idGLDrawableView renderedView
virtual void draw(int x, int y, int w, int h)
virtual void OnDraw(CDC *pDC)
void setShowLights(bool _showLights)
const idMaterial * material
void setLightRadius(const int lightId, const float radius)
void setGlobalParm(int parmNum, float value)
renderEntity_t worldEntity
afx_msg void OnSize(UINT nType, int cx, int cy)
int button
Definition: GLWidget.h:69
idList< lightInfo_t > viewLights
const GLcharARB * name
Definition: glext.h:3629
void OnLocalParmChange(int parmNum, float value)
Definition: Str.h:116
void OnLightShaderChange(int lightId, idStr shaderName)
void MV_OnMaterialSelectionChange(MaterialDoc *pMaterial)
Called when the selected material has changed.
void setLightColor(const int lightId, const idVec3 &value)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct)
Definition: List.h:84
void OnLightColorChange(int lightId, idVec3 &color)
virtual void setMedia(const char *name)
float globalParms[MAX_GLOBAL_SHADER_PARMS]