示例#1
0
		public void Init()
		{
			idConsole.WriteLine("------- Initializing renderSystem --------");

			// clear all our internal state
			_viewCount = 1;	// so cleared structures never match viewCount
			// we used to memset tr, but now that it is a class, we can't, so
			// there may be other state we need to reset

			_ambientLightVector = new Vector4(0.5f, 0.5f - 0.385f, 0.8925f, 1.0f);
			_frameData.Commands = new Queue<RenderCommand>();
			_backendRenderer = new Backends.XNARenderBackend();

			InitCommands();
			InitRenderer();

			_guiModel = new idGuiModel();
			_demoGuiModel = new idGuiModel();
			
			// TODO: R_InitTriSurfData();

			idE.ImageManager.Init();

			// TODO: idCinematic::InitCinematic( );

			// build brightness translation tables
			SetColorMappings();

			InitMaterials();

			idE.RenderModelManager.Init();

			// set the identity space
			_identitySpace = new ViewEntity();

			idConsole.WriteLine("renderSystem initialized.");
			idConsole.WriteLine("--------------------------------------");
		}
示例#2
0
		private void Clear()
		{
			_frameCount = 0;
			_viewCount = 0;

			_staticAllocCount = 0;
			_frameShaderTime = 0;

			_viewPortOffset = Vector2.Zero;
			_tiledViewPort = Vector2.Zero;

			_ambientLightVector = Vector4.Zero;
			_sortOffset = 0;
			_worlds.Clear();

			_primaryRenderWorld = null;
			_primaryView = null;
			_primaryRenderView = new idRenderView();

			_defaultMaterial = null;

			/*
			testImage = NULL;
			ambientCubeImage = NULL;*/

			_viewDefinition = null;

			/*memset( &pc, 0, sizeof( pc ) );
			memset( &lockSurfacesCmd, 0, sizeof( lockSurfacesCmd ) );*/

			_identitySpace = new ViewEntity();

			/*logFile = NULL;*/

			_renderCrops = new idRectangle[idE.MaxRenderCrops];
			_currentRenderCrop = 0;
			_guiRecursionLevel = 0;
			_guiModel = null;
			/*demoGuiModel = NULL;
			memset( gammaTable, 0, sizeof( gammaTable ) );
			takingScreenshot = false;*/
		}