C# Class idTech4.Renderer.idRenderSystem

Responsible for managing the screen, which can have multiple idRenderWorld and 2D drawing done on it.
显示文件 Open project: iainmckay/idtech4.net

Public Properties

Property Type Description
VideoModes idTech4.Renderer.VideoMode[]

Public Methods

Method Description
AddDrawSurface ( Surface surface, ViewEntity space, RenderEntityComponent renderEntity, idMaterial material, idScreenRect scissor ) : void
AddDrawViewCommand ( View view ) : void

This is the main 3D rendering command. A single scene may have multiple views if a mirror, portal, or dynamic texture is present.

BeginFrame ( int windowWidth, int windowHeight ) : void
BeginLevelLoad ( ) : void
BindTexture ( idImage texture ) : void
ClearTextureUnits ( ) : void
CreateRenderWorld ( ) : idRenderWorld

Creates a new renderWorld to be used for drawing.

DebugClearLines ( int time ) : void
DebugClearPolygons ( int time ) : void
DebugClearText ( int time ) : void
DrawBigCharacter ( int x, int y, int ch, idMaterial material ) : void
DrawBigString ( int x, int y, string str, Vector4 color, bool forceColor, idMaterial material ) : void

Draws a multi-colored string with a drop shadow, optionally forcing to a fixed color. Coordinates are at 640 by 480 virtual resolution.

DrawSmallCharacter ( int x, int y, int c, idMaterial material ) : void

Small characters are drawn at native screen resolution.

DrawSmallString ( int x, int y, string str, Vector4 setColor, bool forceColor, idMaterial material ) : void

Draws a multi-colored string with a drop shadow, optionally forcing to a fixed color.

Coordinates are at 640x480 virtual resolution.

DrawStretchPicture ( Vertex vertices, int indexes, idMaterial material, bool clip = true, float minX = 0.0f, float minY = 0.0f, float maxX = 640.0f, float maxY = 0.0f ) : void
DrawStretchPicture ( float x, float y, float width, float height, float s, float t, float s2, float t2, idMaterial material ) : void
EndFrame ( ) : void
EndFrame ( int &frontendTime, int &backendTime ) : void
EndLevelLoad ( ) : void
GlobalMaterialOverride ( idMaterial material ) : idMaterial
Init ( ) : void
InitRenderer ( ) : void
Present ( ) : void
RegisterFont ( string fontName, string fileName ) : idFontFamily
RemapMaterialBySkin ( idMaterial material, idDeclSkin skin, idMaterial customMaterial ) : idMaterial
RenderView ( View parms ) : void

A view may be either the actual camera view, a mirror / remote location, or a 3D view on a gui surface.

RenderViewToViewPort ( idRenderView renderView ) : idScreenRect

Converts from SCREEN_WIDTH / SCREEN_HEIGHT coordinates to current cropped pixel coordinates

idRenderSystem ( ) : System

Private Methods

Method Description
AddAmbientDrawSurfaces ( ViewEntity viewEntity ) : void

Adds surfaces for the given viewEntity Walks through the viewEntitys list and creates drawSurf_t for each surface of each viewEntity that has a non-empty scissorRect.

AddModelSurfaces ( ) : void Here is where dynamic models actually get instantiated, and necessary interactions get created. This is all done on a sort-by-model basis to keep source data in cache (most likely L2) as any interactions and shadows are generated, since dynamic models will typically be lit by two or more lights.
AllocateVertexCacheFrameTemporary ( Vertex vertices ) : VertexCache
Clear ( ) : void
ClearCommandChain ( ) : void

Called after every buffer submission and by ToggleSmpFrame.

Cmd_ReloadArbPrograms ( object sender, CommandEventArgs e ) : void
ConstrainViewFrustum ( ) : void
CreateAmbientCache ( Surface geometry, bool needsLighting ) : bool
EntityDefinitionDynamicModel ( idRenderEntity def ) : idRenderModel

Issues a deferred entity callback if necessary. If the model isn't dynamic, it returns the original. Returns the cached dynamic model if present, otherwise creates it and any necessary overlays

InitCommands ( ) : void
InitCvars ( ) : void
InitMaterials ( ) : void
IssueRenderCommands ( ) : void
LoadArbProgram ( int index ) : void
SetColorMappings ( ) : void
SetGamma ( ushort red, ushort green, ushort blue ) : void

The renderer calls this when the user adjusts r_gamma or r_brightness.

SetViewMatrix ( View view ) : void
SetupProjection ( ) : void
SetupViewFrustum ( ) : void
ToggleSmpFrame ( ) : void

Method Details

AddDrawSurface() public method

public AddDrawSurface ( Surface surface, ViewEntity space, RenderEntityComponent renderEntity, idMaterial material, idScreenRect scissor ) : void
surface Surface
space ViewEntity
renderEntity RenderEntityComponent
material idMaterial
scissor idScreenRect
return void

AddDrawViewCommand() public method

This is the main 3D rendering command. A single scene may have multiple views if a mirror, portal, or dynamic texture is present.
public AddDrawViewCommand ( View view ) : void
view View
return void

BeginFrame() public method

public BeginFrame ( int windowWidth, int windowHeight ) : void
windowWidth int
windowHeight int
return void

BeginLevelLoad() public method

public BeginLevelLoad ( ) : void
return void

BindTexture() public method

public BindTexture ( idImage texture ) : void
texture idImage
return void

ClearTextureUnits() public method

public ClearTextureUnits ( ) : void
return void

CreateRenderWorld() public method

Creates a new renderWorld to be used for drawing.
public CreateRenderWorld ( ) : idRenderWorld
return idRenderWorld

DebugClearLines() public method

public DebugClearLines ( int time ) : void
time int
return void

DebugClearPolygons() public method

public DebugClearPolygons ( int time ) : void
time int
return void

DebugClearText() public method

public DebugClearText ( int time ) : void
time int
return void

DrawBigCharacter() public method

public DrawBigCharacter ( int x, int y, int ch, idMaterial material ) : void
x int
y int
ch int
material idMaterial
return void

DrawBigString() public method

Draws a multi-colored string with a drop shadow, optionally forcing to a fixed color. Coordinates are at 640 by 480 virtual resolution.
public DrawBigString ( int x, int y, string str, Vector4 color, bool forceColor, idMaterial material ) : void
x int
y int
str string
color Vector4
forceColor bool
material idMaterial
return void

DrawSmallCharacter() public method

Small characters are drawn at native screen resolution.
public DrawSmallCharacter ( int x, int y, int c, idMaterial material ) : void
x int
y int
c int
material idMaterial
return void

DrawSmallString() public method

Draws a multi-colored string with a drop shadow, optionally forcing to a fixed color.
Coordinates are at 640x480 virtual resolution.
public DrawSmallString ( int x, int y, string str, Vector4 setColor, bool forceColor, idMaterial material ) : void
x int
y int
str string
setColor Vector4
forceColor bool
material idMaterial
return void

DrawStretchPicture() public method

public DrawStretchPicture ( Vertex vertices, int indexes, idMaterial material, bool clip = true, float minX = 0.0f, float minY = 0.0f, float maxX = 640.0f, float maxY = 0.0f ) : void
vertices Vertex
indexes int
material idMaterial
clip bool
minX float
minY float
maxX float
maxY float
return void

DrawStretchPicture() public method

public DrawStretchPicture ( float x, float y, float width, float height, float s, float t, float s2, float t2, idMaterial material ) : void
x float
y float
width float
height float
s float
t float
s2 float
t2 float
material idMaterial
return void

EndFrame() public method

public EndFrame ( ) : void
return void

EndFrame() public method

public EndFrame ( int &frontendTime, int &backendTime ) : void
frontendTime int
backendTime int
return void

EndLevelLoad() public method

public EndLevelLoad ( ) : void
return void

GlobalMaterialOverride() public method

public GlobalMaterialOverride ( idMaterial material ) : idMaterial
material idMaterial
return idMaterial

Init() public method

public Init ( ) : void
return void

InitRenderer() public method

public InitRenderer ( ) : void
return void

Present() public method

public Present ( ) : void
return void

RegisterFont() public method

public RegisterFont ( string fontName, string fileName ) : idFontFamily
fontName string
fileName string
return idFontFamily

RemapMaterialBySkin() public method

public RemapMaterialBySkin ( idMaterial material, idDeclSkin skin, idMaterial customMaterial ) : idMaterial
material idMaterial
skin idTech4.Text.Decl.idDeclSkin
customMaterial idMaterial
return idMaterial

RenderView() public method

A view may be either the actual camera view, a mirror / remote location, or a 3D view on a gui surface.
public RenderView ( View parms ) : void
parms View
return void

RenderViewToViewPort() public method

Converts from SCREEN_WIDTH / SCREEN_HEIGHT coordinates to current cropped pixel coordinates
public RenderViewToViewPort ( idRenderView renderView ) : idScreenRect
renderView idRenderView
return idScreenRect

idRenderSystem() public method

public idRenderSystem ( ) : System
return System

Property Details

VideoModes public_oe static_oe property

public static VideoMode[],idTech4.Renderer VideoModes
return idTech4.Renderer.VideoMode[]