Example #1
0
	    public Renderer(GraphicsDevice device)
		{
			_bufferedRenderCommandsA = new List<RenderCommand>();
			_bufferedRenderCommandsB = new List<RenderCommand>();
			_updatingRenderCommands = _bufferedRenderCommandsA;

			_renderComandsReady = new ManualResetEvent(false);

			_renderActive = new ManualResetEvent(false);
			_renderCompleted = new ManualResetEvent(true);
			_cubePrimitive = _cubePrimitive ?? new CubePrimitive(device);
		}
		protected override void LoadContent()
		{
			_spriteBatch = new SpriteBatch(GraphicsDevice);
			_spriteFont = Content.Load<SpriteFont>("hudfont");

			var random = new Random(Environment.TickCount);
			for (int i = 0; i < NumPrimitiveObjects; i++)
			{
				var primitive = new CubePrimitive(GraphicsDevice)
					{
						Position = new Vector3(random.Next(100) - 50, random.Next(100) - 50, -random.Next(100))
					};
				_primitives.Add(primitive);
			}

			_wireFrameState = new RasterizerState
			{
				FillMode = FillMode.WireFrame,
				CullMode = CullMode.None,
			};
		}
 public BufferedRenderer(GraphicsDevice device)
 {
     _cubePrimitive = new CubePrimitive(device);
 }