forked from nillerusr/source-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmatnullrendercontext.cpp
847 lines (696 loc) · 23.8 KB
/
cmatnullrendercontext.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================
#include "pch_materialsystem.h"
#include "cmatnullrendercontext.h"
#define MATSYS_INTERNAL
#include "cmatrendercontext.h"
#include "itextureinternal.h"
class CMatNullRenderContext : public CMatRenderContextBase
{
public:
CMatNullRenderContext()
: m_WidthBackBuffer( 0 ),
m_HeightBackBuffer( 0 )
{
}
virtual void InitializeFrom( CMatRenderContextBase *pInitialState )
{
CMatRenderContextBase::InitializeFrom( pInitialState );
g_pShaderAPI->GetBackBufferDimensions( m_WidthBackBuffer, m_HeightBackBuffer );
}
void BeginRender()
{
}
void EndRender()
{
}
void Flush(bool)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void GetRenderTargetDimensions(int &,int &) const
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void DepthRange(float,float)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void ClearBuffers(bool,bool,bool)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void ReadPixels(int,int,int,int,unsigned char *,ImageFormat)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetAmbientLight(float,float,float)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetLight(int,const LightDesc_t &)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetLightingOrigin( Vector vLightingOrigin )
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetAmbientLightCube(Vector4D [])
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void CopyRenderTargetToTexture(ITexture *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetFrameBufferCopyTexture(ITexture *,int)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
ITexture *GetFrameBufferCopyTexture(int)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return NULL;
}
void GetViewport( int& x, int& y, int& width, int& height ) const
{
// Verify valid top of RT stack
Assert ( m_RenderTargetStack.Count() > 0 );
// Grab the top of stack
const RenderTargetStackElement_t& element = m_RenderTargetStack.Top();
// If either dimension is negative, set to full bounds of current target
if ( (element.m_nViewW < 0) || (element.m_nViewH < 0) )
{
// Viewport origin at target origin
x = y = 0;
// If target is back buffer
if ( element.m_pRenderTargets[0] == NULL )
{
width = m_WidthBackBuffer;
height = m_HeightBackBuffer;
}
else // if target is texture
{
width = element.m_pRenderTargets[0]->GetActualWidth();
height = element.m_pRenderTargets[0]->GetActualHeight();
}
}
else // use the bounds from the stack directly
{
x = element.m_nViewX;
y = element.m_nViewY;
width = element.m_nViewW;
height = element.m_nViewH;
}
}
void CullMode(MaterialCullMode_t)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void FogMode(MaterialFogMode_t)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void FogStart(float)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void FogEnd(float)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetFogZ(float)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
MaterialFogMode_t GetFogMode()
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return MATERIAL_FOG_NONE;
}
int GetCurrentNumBones( ) const
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return 0;
}
void FogColor3f(float,float,float)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void FogColor3fv(const float *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void FogColor3ub(unsigned char,unsigned char,unsigned char)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void FogColor3ubv(const unsigned char *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void GetFogColor(unsigned char *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetNumBoneWeights(int)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
IMesh *CreateStaticMesh(VertexFormat_t,const char *,IMaterial *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return NULL;
}
void DestroyStaticMesh(IMesh *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
IMesh *GetDynamicMesh(bool,IMesh *,IMesh *,IMaterial *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return NULL;
}
virtual IMesh* GetDynamicMeshEx( VertexFormat_t, bool, IMesh*, IMesh*, IMaterial * )
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return NULL;
}
int SelectionMode(bool)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return 0;
}
void SelectionBuffer(unsigned int *,int)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void ClearSelectionNames()
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void LoadSelectionName(int)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void PushSelectionName(int)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void PopSelectionName()
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void ClearColor3ub(unsigned char,unsigned char,unsigned char)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void ClearColor4ub(unsigned char,unsigned char,unsigned char,unsigned char)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void OverrideDepthEnable(bool,bool)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void OverrideColorWriteEnable( bool, bool )
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void OverrideAlphaWriteEnable( bool, bool )
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void DrawScreenSpaceQuad(IMaterial *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SyncToken(const char *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
OcclusionQueryObjectHandle_t CreateOcclusionQueryObject()
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return NULL;
}
void DestroyOcclusionQueryObject(OcclusionQueryObjectHandle_t)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void ResetOcclusionQueryObject( OcclusionQueryObjectHandle_t hOcclusionQuery )
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void BeginOcclusionQueryDrawing(OcclusionQueryObjectHandle_t)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void EndOcclusionQueryDrawing(OcclusionQueryObjectHandle_t)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
int OcclusionQuery_GetNumPixelsRendered(OcclusionQueryObjectHandle_t)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return 1;
}
void SetFlashlightMode(bool)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
virtual bool GetFlashlightMode( void ) const
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return false;
}
void SetFlashlightState(const FlashlightState_t &,const VMatrix &)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetScissorRect( const int nLeft, const int nTop, const int nRight, const int nBottom, const bool bEnableScissor )
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
virtual void PushDeformation( DeformationBase_t const *Deformation )
{
}
virtual void PopDeformation( )
{
}
virtual int GetNumActiveDeformations() const
{
return 0;
}
void EnableUserClipTransformOverride(bool)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void UserClipTransform(const VMatrix &)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
IMorph *CreateMorph(MorphFormat_t, const char *pDebugName)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return NULL;
}
void DestroyMorph(IMorph *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void BindMorph(IMorph *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetMorphTargetFactors(int,float *,int)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void ReadPixelsAndStretch(Rect_t *,Rect_t *,unsigned char *,ImageFormat,int)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void GetWindowSize(int &,int &) const
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void DrawScreenSpaceRectangle(IMaterial *,int,int,int,int,float,float,float,float,int,int,void*,int,int)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void LoadBoneMatrix(int,const matrix3x4_t &)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void BindLightmapTexture(ITexture *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void CopyRenderTargetToTextureEx(ITexture *,int,Rect_t *,Rect_t *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void CopyTextureToRenderTargetEx(int,ITexture *,Rect_t *,Rect_t *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetFloatRenderingParameter(int,float)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetIntRenderingParameter(int,int)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetVectorRenderingParameter(int,const Vector &)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetStencilEnable(bool)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetStencilFailOperation(StencilOperation_t)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetStencilZFailOperation(StencilOperation_t)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetStencilPassOperation(StencilOperation_t)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetStencilCompareFunction(StencilComparisonFunction_t)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetStencilReferenceValue(int)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetStencilTestMask(uint32)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetStencilWriteMask(uint32)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void ClearStencilBufferRectangle(int,int,int,int,int)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void PushCustomClipPlane(const float *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void PopCustomClipPlane()
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void GetMaxToRender(IMesh *,bool,int *,int *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
int GetMaxVerticesToRender(IMaterial *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return 0;
}
int GetMaxIndicesToRender()
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return 0;
}
void DisableAllLocalLights()
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
int CompareMaterialCombos(IMaterial *,IMaterial *,int,int)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return 0;
}
IMesh *GetFlexMesh()
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return NULL;
}
void SetFlashlightStateEx(const FlashlightState_t &,const VMatrix &,ITexture *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
ITexture *GetLocalCubemap()
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return NULL;
}
void ClearBuffersObeyStencil(bool,bool)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void ClearBuffersObeyStencilEx( bool bClearColor, bool bClearAlpha, bool bClearDepth )
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void PerformFullScreenStencilOperation( void )
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
bool GetUserClipTransform(VMatrix &)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return true;
}
void GetFogDistances(float *,float *,float *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void BeginPIXEvent(unsigned long,const char *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void EndPIXEvent()
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetPIXMarker(unsigned long,const char *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void BeginBatch(IMesh *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void BindBatch(IMesh *,IMaterial *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void DrawBatch(int,int)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void EndBatch()
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void SetToneMappingScaleLinear(const Vector &)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
float GetFloatRenderingParameter(int) const
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return 0;
}
int GetIntRenderingParameter(int) const
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return 0;
}
Vector GetVectorRenderingParameter(int) const
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return Vector(0,0,0);
}
void SwapBuffers()
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void ForceDepthFuncEquals(bool)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
bool InFlashlightMode() const
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return true;
}
void BindStandardTexture(TextureStage_t,StandardTextureId_t)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void GetLightmapDimensions(int *,int *)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
MorphFormat_t GetBoundMorphFormat()
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return 0;
}
void DrawClearBufferQuad(unsigned char,unsigned char,unsigned char,unsigned char,bool,bool,bool)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
bool OnDrawMesh(IMesh *,CPrimList *,int)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return true;
}
bool OnDrawMesh(IMesh *,int,int)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return true;
}
bool OnSetFlexMesh(IMesh *,IMesh *,int)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return true;
}
bool OnSetColorMesh(IMesh *,IMesh *,int)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return true;
}
bool OnSetPrimitiveType(IMesh *,MaterialPrimitiveType_t)
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return true;
}
bool OnFlushBufferedPrimitives()
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
return true;
}
void ForceHardwareSync()
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void BeginFrame()
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void EndFrame()
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void AsyncCreateTextureFromRenderTarget( ITexture* pSrcRt, const char* pDstName, ImageFormat dstFmt, bool bGenMips, int nAdditionalCreationFlags, IAsyncTextureOperationReceiver* pRecipient, void* pExtraArgs ) OVERRIDE
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
virtual void AsyncMap( ITextureInternal* pTexToMap, IAsyncTextureOperationReceiver* pRecipient, void* pExtraArgs ) OVERRIDE
{
}
virtual void AsyncUnmap( ITextureInternal* pTexToUnmap ) OVERRIDE
{
}
virtual void AsyncCopyRenderTargetToStagingTexture( ITexture* pDst, ITexture* pSrc, IAsyncTextureOperationReceiver* pRecipient, void* pExtraArgs ) OVERRIDE
{
}
void SetShadowDepthBiasFactors( float fSlopeScaleDepthBias, float fDepthBias )
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
void BindStandardTexture( Sampler_t, StandardTextureId_t )
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
// ------------ New Vertex/Index Buffer interface ----------------------------
// Do we need support for bForceTempMesh and bSoftwareVertexShader?
// I don't think we use bSoftwareVertexShader anymore. .need to look into bForceTempMesh.
IVertexBuffer *CreateStaticVertexBuffer( VertexFormat_t fmt, int nVertexCount, const char *pBudgetGroup )
{
Assert( 0 );
return NULL;
}
IIndexBuffer *CreateStaticIndexBuffer( MaterialIndexFormat_t fmt, int nIndexCount, const char *pBudgetGroup )
{
Assert( 0 );
return NULL;
}
void DestroyVertexBuffer( IVertexBuffer * )
{
Assert( 0 );
}
void DestroyIndexBuffer( IIndexBuffer * )
{
Assert( 0 );
}
// Do we need to specify the stream here in the case of locking multiple dynamic VBs on different streams?
IVertexBuffer *GetDynamicVertexBuffer( int streamID, VertexFormat_t vertexFormat, bool bBufferedtrue )
{
Assert( 0 );
return NULL;
}
IIndexBuffer *GetDynamicIndexBuffer( MaterialIndexFormat_t fmt, bool bBufferedtrue )
{
Assert( 0 );
return NULL;
}
void BindVertexBuffer( int streamID, IVertexBuffer *pVertexBuffer, int nOffsetInBytes, int nFirstVertex, int nVertexCount, VertexFormat_t fmt, int nRepetitions1 )
{
Assert( 0 );
}
void BindIndexBuffer( IIndexBuffer *pIndexBuffer, int nOffsetInBytes )
{
Assert( 0 );
}
void Draw( MaterialPrimitiveType_t primitiveType, int firstIndex, int numIndices )
{
Assert( 0 );
}
virtual void BeginMorphAccumulation()
{
Assert( 0 );
}
virtual void EndMorphAccumulation()
{
Assert( 0 );
}
virtual void AccumulateMorph( IMorph* pMorph, int nMorphCount, const MorphWeight_t* pWeights )
{
Assert( 0 );
}
virtual bool GetMorphAccumulatorTexCoord( Vector2D *pTexCoord, IMorph *pMorph, int nVertex )
{
Assert(0);
pTexCoord->Init();
return false;
}
virtual void SetFlexWeights( int nFirstWeight, int nCount, const MorphWeight_t* pWeights ) {}
virtual void FogMaxDensity( float flMaxDensity )
{
AssertMsg( 0, "CMatNullRenderContext only provides base features, not a stub (right now)" );
}
virtual void EnableColorCorrection( bool bEnable ) {}
virtual ColorCorrectionHandle_t AddLookup( const char *pName ) { return 0; }
virtual bool RemoveLookup( ColorCorrectionHandle_t handle ) { return true; }
virtual void LockLookup( ColorCorrectionHandle_t handle ) {}
virtual void LoadLookup( ColorCorrectionHandle_t handle, const char *pLookupName ) {}
virtual void UnlockLookup( ColorCorrectionHandle_t handle ) {}
virtual void SetLookupWeight( ColorCorrectionHandle_t handle, float flWeight ) {}
virtual void ResetLookupWeights( ) {}
virtual void SetResetable( ColorCorrectionHandle_t handle, bool bResetable ) {}
virtual void SetFullScreenDepthTextureValidityFlag( bool bIsValid ) {}
virtual void SetNonInteractivePacifierTexture( ITexture *pTexture, float flNormalizedX, float flNormalizedY, float flNormalizedSize ) {}
virtual void SetNonInteractiveTempFullscreenBuffer( ITexture *pTexture, MaterialNonInteractiveMode_t mode ) {}
virtual void EnableNonInteractiveMode( MaterialNonInteractiveMode_t mode ) {}
virtual void RefreshFrontBufferNonInteractive() {}
#if defined( _X360 )
virtual void PushVertexShaderGPRAllocation( int iVertexShaderCount = 64 )
{
Assert( 0 );
}
virtual void PopVertexShaderGPRAllocation( void )
{
Assert( 0 );
}
#endif
#ifdef DX_TO_GL_ABSTRACTION
void DoStartupShaderPreloading( void ) {};
#endif
void TextureManagerUpdate( void ) { }
int m_WidthBackBuffer, m_HeightBackBuffer;
};
CMatRenderContextBase *CreateNullRenderContext()
{
return new CMatNullRenderContext;
}