Tier2

From Valve Developer Community
Jump to: navigation, search

Tier2 is an engine library containing utility functionality for VConfig, cameras, file handling, primitive rendering and sound. It is closed source and compiled as a static library.

Tier2 header files can be found in <project_path>\src\public\tier2.

Components

Note.pngNote:The items listed here are symbols defined in tier2's header files. Therefore this list is probably far from being complete, as ordinary mortals lack access and knowledge to things happening under the hood.

tier2.h

A higher level link library for general use in the game and tools.

Note.pngNote:This header file #includes tier1.h
Type Name Description
(according to header comments)
global function ConnectTier2Libraries Call this to connect to all tier 2 libraries.
global function DisconnectTier2Libraries Call this to disconnect from all tier 2 libraries.
global function InitDefaultFileSystem Call this to get the file system set up to stdio for utilities, etc.
global function ShutdownDefaultFileSystem
global function InitCommandLineProgram For simple utilities using valve libraries, call the entry point below (Note: this function) in main(). It will init a filesystem for you, init mathlib, and create the command line.
template class CTier2AppSystem Helper empty implementation of an IAppSystem for tier2 libraries

beamsegdraw.h

Type Name Description
(according to header comments)
struct BeamSeg_t
class CBeamSegDraw a simple interface to beam rendering
class CBeamSegDrawArbitrary
global function DrawSprite

camerautils.h

A set of utilities to deal with camera transforms.

Type Name Description
(according to header comments)
struct Camera_t Camera state
global function ComputeViewMatrix accessor for generated matrices
global function ComputeProjectionMatrix accessor for generated matrices
global function ComputeScreenSpacePosition Computes the screen space position given a screen size

fileutils.h

A higher level link library for general use in the game and tools.

Type Name Description
(according to header comments)
global function GetModSubdirectory Builds a directory which is a subdirectory of the current mod
global function GetModContentSubdirectory Builds a directory which is a subdirectory of the current mod's content
global function AddFilesToList Builds a list of all files under a directory with a particular extension
global function GetSearchPath Returns the search path as a list of paths
class CBaseFile Simple file classes. File I/O mode (text/binary, read/write) is based upon the subclass chosen.
Classes with the word Required on them abort with a message if the file can't be opened.
Destructores close the file handle, or it can be explicitly closed with the Close() method.
class COutputFile
class COutputTextFile
class CInputFile
class CInputTextFile
class CRequiredInputTextFile
class CRequiredInputFile

keybindings.h

Type Name Description
(according to header comments)
class CKeyBindings

meshutils.h

A set of utilities to help with generating meshes.

Type Name Description
(according to header comments)
global function GenerateSequentialIndexBuffer
global function GenerateQuadIndexBuffer
global function GeneratePolygonIndexBuffer
global function GenerateLineStripIndexBuffer
global function GenerateLineLoopIndexBuffer

p4helpers.h

Type Name Description
(according to header comments)
class CP4File Class representing file operations
class CP4File_Dummy An override of CP4File performing no Perforce interaction
class CP4Factory Class representing a factory for creating other helper objects
class CP4AutoEditFile edits the file upon construction
class CP4AutoAddFile adds the file upon construction
class CP4AutoEditAddFile edits the file upon construction / adds upon destruction

renderutils.h

Type Name Description
(according to header comments)
global function RenderWireframeSphere Renders a wireframe sphere
global function RenderSphere Renders a sphere
global function RenderWireframeBox Renders a wireframe box relative to an origin
global function RenderWireframeSweptBox Renders a swept wireframe box
global function RenderBox Renders a solid Box
global function RenderAxes Renders axes, red->x, green->y, blue->z (axis aligned)
global function RenderLine Renders a line
global function RenderTriangle Renders a triangle
global function RenderQuad Renders a axis-aligned quad
global function DrawScreenSpaceRectangle Renders a screen space quad

riff.h

Type Name Description
(according to header comments)
interface IFileReadBinary This is a simple abstraction that the RIFF classes use to read from files/memory
class InFileRIFF Used to read/parse a RIFF format file
class IterateRIFF Used to iterate over an InFileRIFF
interface IFileWriteBinary
class OutFileRIFF Used to write a RIFF format file
class IterateOutputRIFF Used to iterate over an InFileRIFF
Note.pngNote:This is probably a typo, as IterateOutputRIFF sounds more like iterating over an OutFileRIFF

soundutils.h

Helper methods + classes for sound

Type Name Description
(according to header comments)
global function GetWavSoundDuration Returns the duration of a wav file

tier2dm.h

Type Name Description
(according to header comments)
global function ConnectDataModel
global function InitDataModel
global function ShutdownDataModel
global function DisconnectDataModel
template class CTier2DmAppSystem Helper empty implementation of an IAppSystem for tier2 libraries

utlstreambuffer.h

Type Name Description
(according to header comments)
class CUtlStreamBuffer Command parsing

vconfig.h

Utilities for setting vproject settings.

Type Name Description
(according to header comments)
global function SetVConfigRegistrySetting
global function GetVConfigRegistrySetting
global function, Win32 only RemoveObsoleteVConfigRegistrySetting
global function ConvertObsoleteVConfigRegistrySetting