summaryrefslogtreecommitdiff
path: root/engine/gl_draw.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /engine/gl_draw.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'engine/gl_draw.cpp')
-rw-r--r--engine/gl_draw.cpp76
1 files changed, 76 insertions, 0 deletions
diff --git a/engine/gl_draw.cpp b/engine/gl_draw.cpp
new file mode 100644
index 0000000..379b7ee
--- /dev/null
+++ b/engine/gl_draw.cpp
@@ -0,0 +1,76 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//
+//=============================================================================//
+
+#include "render_pch.h"
+#include "draw.h"
+#include "decal.h"
+#include "gl_cvars.h"
+#include "view.h"
+#include "screen.h"
+#include "gl_matsysiface.h"
+#include "cdll_int.h"
+#include "materialsystem/imesh.h"
+#include "materialsystem/imaterial.h"
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+Vector g_CurrentViewOrigin(0, 0, 0), g_CurrentViewForward(1, 0, 0), g_CurrentViewRight(0, -1, 0), g_CurrentViewUp(0, 0, 1);
+Vector g_MainViewOrigin(0, 0, 0), g_MainViewForward(1, 0, 0), g_MainViewRight(0, -1, 0), g_MainViewUp(0, 0, 1);
+
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : *pMaterial -
+//-----------------------------------------------------------------------------
+void GL_UnloadMaterial( IMaterial *pMaterial )
+{
+ if ( pMaterial )
+ {
+ pMaterial->DecrementReferenceCount();
+ }
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : *pName -
+// Output : IMaterial
+//-----------------------------------------------------------------------------
+static IMaterial *GL_LoadMaterialNoRef( const char *pName, const char *pTextureGroupName )
+{
+ IMaterial *material = NULL;
+
+ if( mat_loadtextures.GetInt() )
+ {
+ material = materials->FindMaterial( pName, pTextureGroupName );
+ }
+ else
+ {
+ material = g_materialEmpty;
+ }
+
+ return material;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : *pName -
+// Output : IMaterial
+//-----------------------------------------------------------------------------
+IMaterial *GL_LoadMaterial( const char *pName, const char *pTextureGroupName )
+{
+ IMaterial *material;
+
+ material = GL_LoadMaterialNoRef( pName, pTextureGroupName );
+ if( material )
+ {
+ material->IncrementReferenceCount();
+ }
+ return material;
+}
+