doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MaterialPreviewView.cpp
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 
29 
30 #include "../../../idlib/precompiled.h"
31 #pragma hdrstop
32 
33 #include "../radiant/QE3.H"
34 #include "MaterialPreviewView.h"
35 
36 
37 // MaterialPreviewView
39 
41  // Initialize the rendered material
42  renderedView.setMedia( "_default" );
43 }
44 
46 }
47 
48 BEGIN_MESSAGE_MAP(MaterialPreviewView, CView)
49  ON_WM_CREATE()
50  ON_WM_SIZE()
51 END_MESSAGE_MAP()
52 
53 
54 // MaterialPreviewView drawing
55 
56 void MaterialPreviewView::OnDraw(CDC* pDC) {
57 }
58 
59 // MaterialPreviewView diagnostics
60 
61 #ifdef _DEBUG
62 void MaterialPreviewView::AssertValid() const {
63  CView::AssertValid();
64 }
65 
66 void MaterialPreviewView::Dump(CDumpContext& dc) const {
67  CView::Dump(dc);
68 }
69 #endif //_DEBUG
70 
71 // MaterialPreviewView message handlers
72 
73 int MaterialPreviewView::OnCreate(LPCREATESTRUCT lpCreateStruct)
74 {
75  if (CView::OnCreate(lpCreateStruct) == -1)
76  return -1;
77 
78  DWORD dwStyle;
79  CRect rc;
80 
81  dwStyle = WS_CHILD|WS_VISIBLE;
82 
83  // Init the control's size to cover the entire client area
84  GetClientRect(rc);
85 
86  // Initialize the rendered window and material
87  renderWindow.Create( NULL, "renderWindow", dwStyle, rc, this, 1010 );
88 
90  renderWindow.SetWindowPos(NULL, 0, 0, rc.Width(), rc.Height(), SWP_SHOWWINDOW);
91 
92  return 0;
93 }
94 
95 void MaterialPreviewView::OnSize(UINT nType, int cx, int cy)
96 {
97  CRect rc;
98 
99  CView::OnSize( nType, cx, cy );
100 
101  GetClientRect( rc );
102 
103  renderWindow.SetWindowPos(NULL, 0, 0, rc.Width(), rc.Height(), SWP_SHOWWINDOW);
104  renderWindow.Invalidate();
105  renderWindow.RedrawWindow();
106 }
107 
109 {
110  if ( pMaterial && pMaterial->renderMaterial ) {
111 
112  currentMaterial = pMaterial->renderMaterial->GetName();
114 
115  renderWindow.Invalidate();
116  renderWindow.RedrawWindow();
117  }
118 }
119 
120 void MaterialPreviewView::OnLocalParmChange( int parmNum, float value ) {
121 
122  renderedView.setLocalParm( parmNum, value );
123 }
124 
125 void MaterialPreviewView::OnGlobalParmChange( int parmNum, float value ) {
126 
127  renderedView.setGlobalParm( parmNum, value );
128 }
129 
130 void MaterialPreviewView::OnLightShaderChange( int lightId, idStr shaderName ) {
131 
132  renderedView.setLightShader( lightId, shaderName );
133 }
134 
136 
137  renderedView.setLightColor( lightId, color );
138 }
139 
140 void MaterialPreviewView::OnLightRadiusChange( int lightId, float radius ) {
141 
142  renderedView.setLightRadius( lightId, radius );
143 }
144 
145 void MaterialPreviewView::OnLightAllowMoveChange( int lightId, bool move ) {
146 
147  renderedView.setLightAllowMove( lightId, move );
148 }
149 
151 
153 }
154 
156 
157  renderedView.deleteLight( lightId );
158 }
159 
161 
162  renderedView.setObject( modelId );
163 }
164 
166 
167  renderedView.setCustomModel( modelName );
168 }
169 
171 
172  renderedView.setShowLights( showLights );
173 }
174 
175 /*
176  =============================================================================
177  =============================================================================
178  =============================================================================
179  */
180 
181 extern bool Sys_KeyDown(int key);
182 extern float fDiff(float f1, float f2);
183 
185  material = NULL;
186  modelDefHandle = -1;
187 
188  objectId = 0;
189  showLights = true;
190  realTime = 16;
191 
192  viewOrigin.Set( 0.f, 0.f, 0.f );
193  viewRotation.Set( 0.f, 0.f, 0.f );
194  viewDistance = -196.f;
195 
196  world = NULL;
197  worldModel = NULL;
198 
199  ResetView();
200 }
201 
203  delete world;
204  delete worldModel;
205 }
206 
208  idDict spawnArgs;
209 
210  InitWorld();
211 
212  memset( &worldEntity, 0, sizeof( worldEntity ) );
213  spawnArgs.Clear();
214  spawnArgs.Set("classname", "func_static");
215  spawnArgs.Set("name", spawnArgs.GetString("model"));
216  spawnArgs.Set("origin", "0 0 0");
217 
219 
220  // load a model and set the current material as its customshader
221  worldModel = renderModelManager->FindModel("models/materialeditor/cube128.ase");
223 
224  // current material
226 
227  // current rotation
229 
230  // set global shader parms
231  memset( globalParms, 0, sizeof( globalParms ) );
232  globalParms[0] = globalParms[1] = globalParms[2] = globalParms[3] = 1.f;
233 
234  worldEntity.shaderParms[0] = 1.f;
235  worldEntity.shaderParms[1] = 1.f;
236  worldEntity.shaderParms[2] = 1.f;
237  worldEntity.shaderParms[3] = 1.f;
239 }
240 
242 
243  if ( world == NULL ) {
245  }
246  if ( worldModel == NULL ) {
248  }
249 
250  world->InitFromMap( NULL );
251  worldModel->InitEmpty( "GLWorldModel" );
252 
253  viewLights.Clear();
254 }
255 
256 void idGLDrawableView::buttonDown(int _button, float x, float y) {
257  pressX = x;
258  pressY = y;
259  button = _button;
260  if ( button == MK_RBUTTON || button == MK_LBUTTON || button == MK_MBUTTON ) {
261  handleMove = true;
262  }
263 }
264 
265 void idGLDrawableView::mouseMove(float x, float y) {
266  bool doZoom;
267  float sensitivity = 0.5f;
268 
269  if (handleMove) {
270 
271  // Left mouse button rotates and zooms the view
272  if (button == MK_LBUTTON) {
273  doZoom = Sys_KeyDown(VK_MENU);
274  if (doZoom) {
275  if ( y != pressY ) {
276  viewDistance -= ( y - pressY );
277  pressY = y;
278  }
279  } else {
280  float xo = 0.f;
281  float yo = 0.f;
282 
283  if (x != pressX) {
284  xo = (x - pressX);
285  pressX = x;
286  }
287  if (y != pressY) {
288  yo = (y - pressY);
289  pressY = y;
290  }
291 
292  viewRotation.yaw += -(xo * sensitivity);
293  viewRotation.pitch += (yo * sensitivity);
294 
296  }
297 
298  // Right mouse button moves lights in the view plane
299  } else if (button == MK_RBUTTON) {
300  int i;
301  float lightMovement = 0;
302  idVec3 lightForward, lightRight, lightUp;
303  idVec3 lightMove;
304 
305  lightMove.Zero();
306  viewRotation.ToVectors( &lightForward, &lightRight, &lightUp );
307 
308  doZoom = Sys_KeyDown(VK_MENU);
309  if (doZoom) {
310  if ( y != pressY ) {
311  lightMovement = -( y - pressY ) * sensitivity;
312  pressY = y;
313 
314  lightMovement = idMath::ClampFloat( -32.f, 32.f, lightMovement );
315  lightMove = lightForward * lightMovement;
316  }
317  } else {
318  if (x != pressX) {
319  lightMovement = (x - pressX) * sensitivity;
320  pressX = x;
321 
322  lightMovement = idMath::ClampFloat( -32.f, 32.f, lightMovement );
323  lightMove = lightRight * lightMovement;
324  }
325  if (y != pressY) {
326  lightMovement = -(y - pressY) * sensitivity;
327  pressY = y;
328 
329  lightMovement = idMath::ClampFloat( -32.f, 32.f, lightMovement );
330  lightMove += lightUp * lightMovement;
331  }
332  }
333 
334  // Go through the lights and move the ones that are set to allow movement
335  for ( i = 0; i < viewLights.Num(); i++ ) {
336  lightInfo_t *vLight = &viewLights[i];
337 
338  if ( vLight->allowMove ) {
339  vLight->origin += lightMove;
340  }
341  }
342 
343  // Middle mouse button moves object up and down
344  } else if ( button == MK_MBUTTON ) {
345  float yo = 0.f;
346 
347  if (y != pressY) {
348  yo = (y - pressY);
349  pressY = y;
350  }
351 
352  viewOrigin.z -= yo;
353 
354  UpdateModel();
355  }
356  }
357 }
358 
360  int lightId;
361  idStr str;
362  lightInfo_t viewLight;
363  idDict spawnArgs;
364 
365  lightId = viewLights.Num();
366 
367  spawnArgs.Set( "classname", "light" );
368  spawnArgs.Set( "name", va( "light_%d", lightId ) );
369  spawnArgs.Set( "origin", va( "-128 0 %d", (lightId * 16) ) );
370  spawnArgs.Set( "light", "300" );
371  spawnArgs.Set( "texture", "lights/defaultPointLight" );
372  sprintf( str, "%f %f %f", 1.f, 1.f, 1.f );
373  spawnArgs.Set( "_color", str );
374  gameEdit->ParseSpawnArgsToRenderLight( &spawnArgs, &viewLight.renderLight );
375 
376  viewLight.lightDefHandle = world->AddLightDef( &viewLight.renderLight );
377  viewLight.origin = viewLight.renderLight.origin;
378  viewLight.shader = declManager->FindMaterial( "lights/defaultPointLight", false );
379  viewLight.color.x = viewLight.renderLight.shaderParms[ SHADERPARM_RED ];
380  viewLight.color.y = viewLight.renderLight.shaderParms[ SHADERPARM_GREEN ];
381  viewLight.color.z = viewLight.renderLight.shaderParms[ SHADERPARM_BLUE ];
382  viewLight.radius = 300.f;
383  viewLight.allowMove = true;
384 
385  // Add light to the list
386  viewLights.Append( viewLight );
387 }
388 
389 void idGLDrawableView::deleteLight( const int lightId ) {
390  if ( lightId < viewLights.Num() ) {
391  world->FreeLightDef( viewLights[lightId].lightDefHandle );
392 
393  viewLights.RemoveIndex( lightId );
394  }
395 }
396 
398  idVec3 pos, dir;
399  idAngles angs;
400 
401  // Set the camera origin
402  pos = viewRotation.ToForward();
403  pos *= viewDistance;
404  refdef->vieworg = pos;
405 
406  // Set the view to point back at the origin
407  dir = vec3_origin - pos;
408  angs = dir.ToAngles();
409  refdef->viewaxis = angs.ToMat3();
410 }
411 
412 
414 
415  switch( objectId ) {
416  case 0:
417  worldModel = renderModelManager->FindModel("models/materialeditor/cube128.ase");
418  break;
419  case 1:
420  worldModel = renderModelManager->FindModel("models/materialeditor/box128x64.ase");
421  break;
422  case 2:
423  worldModel = renderModelManager->FindModel("models/materialeditor/box128x32.ase");
424  break;
425  case 3:
426  worldModel = renderModelManager->FindModel("models/materialeditor/box64x128.ase");
427  break;
428  case 4:
429  worldModel = renderModelManager->FindModel("models/materialeditor/box32x128.ase");
430  break;
431  case 5:
432  worldModel = renderModelManager->FindModel("models/materialeditor/cylinder_v.ase");
433  break;
434  case 6:
435  worldModel = renderModelManager->FindModel("models/materialeditor/cylinder_h.ase");
436  break;
437  case 7:
438  worldModel = renderModelManager->FindModel("models/materialeditor/sphere64.ase");
439  break;
440  case -1:
442  break;
443  default:
444  worldModel = renderModelManager->FindModel("models/materialeditor/cube128.ase");
445  break;
446  };
447 
449 
450  // current material
452  // current rotation
454 
456 
458 }
459 
461  int i;
462 
463  for ( i = 0; i < viewLights.Num(); i++ ) {
464  lightInfo_t *vLight = &viewLights[i];
465 
466  vLight->renderLight.shader = vLight->shader;
467 
468  vLight->renderLight.shaderParms[ SHADERPARM_RED ] = vLight->color.x;
469  vLight->renderLight.shaderParms[ SHADERPARM_GREEN ] = vLight->color.y;
470  vLight->renderLight.shaderParms[ SHADERPARM_BLUE ] = vLight->color.z;
471 
472  vLight->renderLight.lightRadius[0] = vLight->renderLight.lightRadius[1] =
473  vLight->renderLight.lightRadius[2] = vLight->radius;
474 
475  vLight->renderLight.origin = vLight->origin;
476 
477  world->UpdateLightDef( vLight->lightDefHandle, &vLight->renderLight );
478  }
479 }
480 
482  int i;
483 
484  for ( i=0; i < viewLights.Num(); i++ ) {
485  lightInfo_t *vLight = &viewLights[i];
486 
487  idVec4 lColor;
488  lColor.x = vLight->color.x;
489  lColor.y = vLight->color.y;
490  lColor.z = vLight->color.z;
491  lColor.w = 1.f;
492 
493  idSphere sphere(vLight->renderLight.origin, 4);
494  session->rw->DebugSphere( lColor, sphere, 0, true );
495  session->rw->DrawText( va( "%d", i+1 ), vLight->renderLight.origin + idVec3(0,0,5), 0.25f, idVec4(1,1,0,1), refdef->viewaxis, 1, 0, true );
496  }
497 }
498 
499 
500 void idGLDrawableView::draw(int x, int y, int w, int h) {
501  int i;
502  renderView_t refdef;
503  const idMaterial *mat = material;
504 
505  if (mat) {
506  qglViewport(x, y, w, h);
507  qglScissor(x, y, w, h);
508  qglMatrixMode(GL_PROJECTION);
509  qglClearColor( 0.1f, 0.1f, 0.1f, 0.0f );
510  qglClear(GL_COLOR_BUFFER_BIT);
511 
512  UpdateLights();
513 
514  // render it
515  renderSystem->BeginFrame(w, h);
516 
517  memset( &refdef, 0, sizeof( refdef ) );
518 
519  UpdateCamera( &refdef );
520 
521  // Copy global shaderparms to view
522  for( i = 0; i < MAX_GLOBAL_SHADER_PARMS; i++ ) {
523  refdef.shaderParms[ i ] = globalParms[ i ];
524  }
525 
526  refdef.width = SCREEN_WIDTH;
527  refdef.height = SCREEN_HEIGHT;
528  refdef.fov_x = 90;
529  refdef.fov_y = 2 * atan((float)h / w) * idMath::M_RAD2DEG;
530 
531  refdef.time = eventLoop->Milliseconds();
532 
533  world->RenderScene( &refdef );
534 
535  if ( showLights ) {
536  drawLights( &refdef );
537  }
538 
540 
541  world->DebugClearLines( refdef.time );
542 
543  qglMatrixMode( GL_MODELVIEW );
544  qglLoadIdentity();
545  }
546 }
547 
548 // ============================
549 // Interface to PropTree Window
550 // ============================
551 
552 void idGLDrawableView::setMedia(const char *name) {
553  float ratio = 1;
554 
555  if (name && *name) {
557  } else {
558  material = NULL;
559  }
560 
561  if ( material->GetNumStages() == 0 ) {
562  material = declManager->FindMaterial( "_default" );
563  }
564 
565  if ( material->GetStage(0)->texture.image ) {
566  ratio = (float)((float)material->GetImageWidth() / (float)material->GetImageHeight());
567  }
568 
569  if ( objectId == -1 ) {
570  // Don't change a custom model
571  } else if ( ratio == 1 ) {
572  objectId = 0;
573  } else if ( ratio == 2 ) {
574  objectId = 1;
575  } else if ( ratio == 4 ) {
576  objectId = 2;
577  } else if ( ratio == 0.5 ) {
578  objectId = 3;
579  } else if ( ratio == 0.25 ) {
580  objectId = 4;
581  }
582 
583  UpdateModel();
584 }
585 
586 void idGLDrawableView::setLocalParm( int parmNum, float value ) {
587  if ( parmNum < 0 || parmNum >= MAX_ENTITY_SHADER_PARMS ) {
588  return;
589  }
590 
591  worldEntity.shaderParms[ parmNum ] = value;
592 
593  UpdateModel();
594 }
595 
596 void idGLDrawableView::setGlobalParm( int parmNum, float value ) {
597  if ( parmNum < 0 || parmNum >= MAX_GLOBAL_SHADER_PARMS ) {
598  return;
599  }
600 
601  globalParms[ parmNum ] = value;
602 }
603 
604 void idGLDrawableView::setLightShader( const int lightId, const idStr shaderName ) {
605 
606  if ( lightId < viewLights.Num() ) {
607  viewLights[ lightId ].shader = declManager->FindMaterial( shaderName, false );
608  }
609 }
610 
611 void idGLDrawableView::setLightColor( const int lightId, const idVec3 &value ) {
612 
613  if ( lightId < viewLights.Num() ) {
614  // Update this lights color
615  viewLights[ lightId ].color = value;
616  }
617 }
618 
619 void idGLDrawableView::setLightRadius( const int lightId, const float radius ) {
620 
621  if ( lightId < viewLights.Num() ) {
622  viewLights[ lightId ].radius = radius;
623  }
624 }
625 
626 void idGLDrawableView::setLightAllowMove( const int lightId, const bool move ) {
627 
628  if ( lightId < viewLights.Num() ) {
629  viewLights[ lightId ].allowMove = move;
630  }
631 }
632 
634  objectId = Id;
635 
636  UpdateModel();
637 }
638 
639 void idGLDrawableView::setCustomModel( const idStr modelName ) {
640 
641  if ( modelName.Length() ) {
642  objectId = -1;
643  } else {
644  objectId = 0;
645  }
646 
647  customModelName = modelName;
648 
649  UpdateModel();
650 }
651 
652 void idGLDrawableView::setShowLights( bool _showLights ) {
653  showLights = _showLights;
654 }
655 
byte color[4]
Definition: MegaTexture.cpp:54
void setLightAllowMove(const int lightId, const bool move)
GLsizei const GLfloat * value
Definition: glext.h:3614
virtual void EndFrame(int *frontEndMsec, int *backEndMsec)=0
#define qglScissor
Definition: qgl_linked.h:280
idRenderWorld * world
virtual void FreeLightDef(qhandle_t lightHandle)=0
idMat3 mat3_identity(idVec3(1, 0, 0), idVec3(0, 1, 0), idVec3(0, 0, 1))
const int MAX_GLOBAL_SHADER_PARMS
Definition: RenderWorld.h:44
void setCustomModel(const idStr modelName)
float y
Definition: Vector.h:811
int realTime
Definition: GLWidget.h:70
idMaterial * renderMaterial
Definition: MaterialDoc.h:72
virtual void buttonDown(int _button, float x, float y)
CONST PIXELFORMATDESCRIPTOR UINT
Definition: win_qgl.cpp:47
bool handleMove
Definition: GLWidget.h:68
const int GetNumStages(void) const
Definition: Material.h:365
#define qglClearColor
Definition: qgl_linked.h:41
virtual qhandle_t AddEntityDef(const renderEntity_t *re)=0
void OnModelChange(int modelId)
int Length(void) const
Definition: Str.h:702
void Set(const float x, const float y, const float z)
Definition: Vector.h:409
DWORD
Definition: win_qgl.cpp:61
GLenum GLint GLint y
Definition: glext.h:2849
const int SCREEN_HEIGHT
Definition: RenderSystem.h:154
void setLightShader(const int lightId, const idStr shaderName)
idRenderSystem * renderSystem
float z
Definition: Vector.h:812
float z
Definition: Vector.h:320
void OnDeleteLight(int lightId)
float pressY
Definition: GLWidget.h:67
static float ClampFloat(float min, float max, float value)
Definition: Math.h:893
void setLocalParm(int parmNum, float value)
const char * GetName(void) const
Definition: DeclManager.h:140
Definition: Vector.h:316
case const float
Definition: Callbacks.cpp:62
const int SHADERPARM_GREEN
Definition: RenderWorld.h:47
int GetImageHeight(void) const
Definition: Material.cpp:2526
idRenderModel * worldModel
virtual qhandle_t AddLightDef(const renderLight_t *rlight)=0
virtual const idMaterial * FindMaterial(const char *name, bool makeDefault=true)=0
#define qglViewport
Definition: qgl_linked.h:364
void Set(const char *key, const char *value)
Definition: Dict.cpp:275
float x
Definition: Vector.h:318
GLenum GLint x
Definition: glext.h:2849
virtual void BeginFrame(int windowWidth, int windowHeight)=0
int i
Definition: process.py:33
const idMaterial * customShader
Definition: RenderWorld.h:123
void drawLights(renderView_t *refdef)
void setDrawable(idGLDrawable *d)
Definition: GLWidget.cpp:801
const int MAX_ENTITY_SHADER_PARMS
Definition: Material.h:258
idGameEdit * gameEdit
Definition: GameEdit.cpp:668
float shaderParms[MAX_ENTITY_SHADER_PARMS]
Definition: RenderWorld.h:201
virtual void InitEmpty(const char *name)=0
float fDiff(float f1, float f2)
Definition: XYWnd.cpp:117
void deleteLight(const int lightId)
const int SHADERPARM_BLUE
Definition: RenderWorld.h:48
static const float M_RAD2DEG
Definition: Math.h:215
void OnLightRadiusChange(int lightId, float radius)
idRenderWorld * rw
Definition: Session.h:153
bool Sys_KeyDown(int key)
Definition: NewTexWnd.cpp:49
void Set(float pitch, float yaw, float roll)
Definition: Angles.h:120
virtual idRenderWorld * AllocRenderWorld(void)=0
Responsible for managing a single material that is being viewed and/or edited.
Definition: MaterialDoc.h:67
idAngles ToAngles(void) const
Definition: Vector.cpp:130
const char * GetString(const char *key, const char *defaultString="") const
Definition: Dict.h:240
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:3454
Definition: Vector.h:808
idVec3 lightRadius
Definition: RenderWorld.h:178
idVec3 ToForward(void) const
Definition: Angles.cpp:117
void OnCustomModelChange(idStr modelName)
const shaderStage_t * GetStage(const int index) const
Definition: Material.h:368
void OnShowLightsChange(bool showLights)
idVec3 vec3_origin(0.0f, 0.0f, 0.0f)
virtual void mouseMove(float x, float y)
void OnLightAllowMoveChange(int lightId, bool move)
Definition: Dict.h:65
#define NULL
Definition: Lib.h:88
void Clear(void)
Definition: Dict.cpp:201
virtual idRenderModel * FindModel(const char *modelName)=0
void OnGlobalParmChange(int parmNum, float value)
float y
Definition: Vector.h:319
void UpdateCamera(renderView_t *refdef)
idImage * image
Definition: Material.h:161
float w
Definition: Vector.h:813
virtual void DebugClearLines(int time)=0
float shaderParms[MAX_GLOBAL_SHADER_PARMS]
Definition: RenderWorld.h:223
virtual bool InitFromMap(const char *mapName)=0
virtual void UpdateEntityDef(qhandle_t entityHandle, const renderEntity_t *re)=0
idGLDrawableView renderedView
virtual void DrawText(const char *text, const idVec3 &origin, float scale, const idVec4 &color, const idMat3 &viewAxis, const int align=1, const int lifetime=0, bool depthTest=false)=0
virtual void draw(int x, int y, int w, int h)
float pitch
Definition: Angles.h:53
virtual void DebugSphere(const idVec4 &color, const idSphere &sphere, const int lifetime=0, bool depthTest=false)=0
float pressX
Definition: GLWidget.h:66
void setShowLights(bool _showLights)
idRenderModel * hModel
Definition: RenderWorld.h:81
virtual void UpdateLightDef(qhandle_t lightHandle, const renderLight_t *rlight)=0
const idMaterial * material
void setLightRadius(const int lightId, const float radius)
void setGlobalParm(int parmNum, float value)
idDeclManager * declManager
idEventLoop * eventLoop
Definition: EventLoop.cpp:35
renderEntity_t worldEntity
afx_msg void OnSize(UINT nType, int cx, int cy)
idVec3 vieworg
Definition: RenderWorld.h:215
int button
Definition: GLWidget.h:69
idRenderModelManager * renderModelManager
const int SHADERPARM_RED
Definition: RenderWorld.h:46
const int SCREEN_WIDTH
Definition: RenderSystem.h:153
float yaw
Definition: Angles.h:54
IMPLEMENT_DYNCREATE(CCamWnd, CWnd)
tuple f
Definition: idal.py:89
textureStage_t texture
Definition: Material.h:210
idMat3 ToMat3(void) const
Definition: Angles.cpp:199
idList< lightInfo_t > viewLights
const GLcharARB * name
Definition: glext.h:3629
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID, CCreateContext *pContext=NULL)
Definition: GLWidget.cpp:140
void OnLocalParmChange(int parmNum, float value)
#define qglClear
Definition: qgl_linked.h:39
Definition: Str.h:116
int GetImageWidth(void) const
Definition: Material.cpp:2516
void OnLightShaderChange(int lightId, idStr shaderName)
void MV_OnMaterialSelectionChange(MaterialDoc *pMaterial)
Called when the selected material has changed.
const char * c_str(void) const
Definition: Str.h:487
void setLightColor(const int lightId, const idVec3 &value)
virtual void ParseSpawnArgsToRenderLight(const idDict *args, renderLight_t *renderLight)
Definition: Light.cpp:80
virtual void RenderScene(const renderView_t *renderView)=0
virtual void ParseSpawnArgsToRenderEntity(const idDict *args, renderEntity_t *renderEntity)
Definition: Entity.cpp:229
#define qglLoadIdentity
Definition: qgl_linked.h:186
idSession * session
Definition: Session.cpp:48
char * va(const char *fmt,...)
Definition: Str.cpp:1568
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct)
const idMaterial * shader
Definition: RenderWorld.h:200
idMat3 viewaxis
Definition: RenderWorld.h:216
void ToVectors(idVec3 *forward, idVec3 *right=NULL, idVec3 *up=NULL) const
Definition: Angles.cpp:92
void OnLightColorChange(int lightId, idVec3 &color)
float x
Definition: Vector.h:810
void Zero(void)
Definition: Vector.h:415
float shaderParms[MAX_ENTITY_SHADER_PARMS]
Definition: RenderWorld.h:127
#define qglMatrixMode
Definition: qgl_linked.h:203
int sprintf(idStr &string, const char *fmt,...)
Definition: Str.cpp:1528
int Milliseconds(void)
Definition: EventLoop.cpp:248
virtual void setMedia(const char *name)
virtual idRenderModel * AllocModel()=0
float globalParms[MAX_GLOBAL_SHADER_PARMS]