MCPcopy Create free account
hub / github.com/ZDoom/Raze / Set2D

Method Set2D

source/common/rendering/hwrenderer/data/hw_viewpointbuffer.cpp:83–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83void HWViewpointBuffer::Set2D(FRenderState &di, int width, int height, int pll)
84{
85 HWViewpointUniforms matrices;
86
87 matrices.mViewMatrix.loadIdentity();
88 matrices.mNormalViewMatrix.loadIdentity();
89 matrices.mViewHeight = 0;
90 matrices.mGlobVis = 1.f;
91 matrices.mPalLightLevels = pll;
92 matrices.mClipLine.X = -10000000.0f;
93 matrices.mShadowmapFilter = gl_shadowmap_filter;
94 matrices.mLightBlendMode = 0;
95
96 matrices.mProjectionMatrix.ortho(0, (float)width, (float)height, 0, -1.0f, 1.0f);
97 matrices.CalcDependencies();
98
99 CheckSize();
100 mBuffer->Map();
101 memcpy(((char*)mBuffer->Memory()) + mUploadIndex * mBlockAlign, &matrices, sizeof(matrices));
102 mBuffer->Unmap();
103
104 mClipPlaneInfo.Push(0);
105
106 Bind(di, mUploadIndex++);
107}
108
109int HWViewpointBuffer::SetViewpoint(FRenderState &di, HWViewpointUniforms *vp)
110{

Callers 4

Draw2DFunction · 0.80
ClearScreenMethod · 0.80
ClearScreenMethod · 0.80
ClearScreenMethod · 0.80

Calls 7

loadIdentityMethod · 0.80
orthoMethod · 0.80
CalcDependenciesMethod · 0.80
MemoryMethod · 0.80
MapMethod · 0.45
UnmapMethod · 0.45
PushMethod · 0.45

Tested by

no test coverage detected