protected override void OnRenderedLayerPhase(ILayer layer, RenderPhase phase) { if (WebMapView.ClientDisconnected) { throw new ClientDisconnectedException(); } base.OnRenderedLayerPhase(layer, phase); }
protected override void RenderFeatureLayer(IFeatureLayer layer, RenderPhase phase) { if (_isRenderingAll) { base.RenderFeatureLayer(layer, phase); } else { RenderAllLayers(phase); } }
public static void Setup(GraphicsDevice g) { graphics = g; spriteBatch = new SpriteBatch(graphics); Phase = RenderPhase.Compositing; rtDiffuse = new RenderTarget2D(graphics, graphics.Viewport.Width, graphics.Viewport.Height, true, SurfaceFormat.Color, DepthFormat.None, 0, RenderTargetUsage.DiscardContents); rtDSE = new RenderTarget2D(graphics, graphics.Viewport.Width, graphics.Viewport.Height, true, SurfaceFormat.Color, DepthFormat.None, 0, RenderTargetUsage.DiscardContents); rtNormal = new RenderTarget2D(graphics, graphics.Viewport.Width, graphics.Viewport.Height, true, SurfaceFormat.Color, DepthFormat.None, 0, RenderTargetUsage.DiscardContents); rtLighting = new RenderTarget2D(graphics, graphics.Viewport.Width, graphics.Viewport.Height, true, SurfaceFormat.Color, DepthFormat.None, 0, RenderTargetUsage.DiscardContents); }
/// <summary> /// Adds a single scanline character into the matrix /// </summary> public void AddScanlineCharacter(int index, RenderPhase phase, byte vid1, byte vid2, int[] pens) { if (index >= 64) { return; } switch (phase) { case RenderPhase.BORDER: AddBorderValue(index, CRTDevice.CPCHardwarePalette[pens[16]]); break; case RenderPhase.DISPLAY: AddDisplayValue(index, vid1, vid2, pens); break; default: AddSyncValue(index, phase); break; } }
private void DebugDel(string name, RenderTarget2D t, RenderPhase phase) { if (t != null) { // The constantly switching to and from the debug-rendertarget only works if it's set to 'preserveContents' which is something // I wouldn't recommend doing in a real game-environment. GraphicsDevice.SetRenderTarget(DebugTarget); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); float f = 7; spriteBatch.Draw(t, new Rectangle(((int)phase + 1) * Resolution.X / (int)f, 5 * (Resolution.Y / (int)f), (int)(Resolution.X / f), (int)(Resolution.Y / f)), Color.White); spriteBatch.DrawString(Font, phase + ":", new Vector2(((int)phase + 1f) * Resolution.X / (int)f, 5 * (Resolution.Y / (int)f) - 10), Demo.GetLerpColor(GameTime)); spriteBatch.End(); } }
public static void Draw(GameTime gameTime) { var mat = Matrix.Identity; mat.Translation = new Vector3(0f, 0f, 0f); Phase = RenderPhase.Ships; graphics.SetRenderTargets( rtDiffuse, rtNormal, rtDSE ); spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, RasterizerState.CullNone, fxTilemap, mat); HWGame.globalInstance.CurrentScene.Draw(gameTime); spriteBatch.End(); Phase = RenderPhase.Sprites; spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, RasterizerState.CullNone, fxSprite, mat); HWGame.globalInstance.CurrentScene.Draw(gameTime); spriteBatch.End(); }
/// <summary> /// Adds a HSYNC, VSYNC or HSYNC+VSYNC character into the scanline /// </summary> private void AddSyncValue(int charIndex, RenderPhase phase) { Characters[charIndex].Phase = phase; Characters[charIndex].Pixels = new int[0]; }
protected override void OnRenderingAllLayersPhase(RenderPhase phase) { _isRenderingAll = true; base.OnRenderingAllLayersPhase(phase); }
protected override void RenderFeatureLayer(IFeatureLayer layer, RenderPhase phase) { IFeatureRenderer renderer = GetRenderer <IFeatureRenderer>(layer); renderer.RenderTransform = ToViewTransform; Debug.Assert(renderer != null); Debug.Assert(layer.Style is FeatureStyle); FeatureStyle layerStyle = layer.Style as FeatureStyle; switch (phase) { case RenderPhase.Normal: IEnumerable <FeatureDataRow> features = EnumerateWhileMonitoringClientConnection(layer.Features.Select(ViewEnvelopeInternal.ToGeometry())); foreach (FeatureDataRow feature in features) { FeatureStyle style = getStyleForFeature(layer, feature, layerStyle); IEnumerable renderedFeature = renderer.RenderFeature(feature, style, RenderState.Normal, layer); View.ShowRenderedObjects(renderedFeature); } break; case RenderPhase.Selected: IEnumerable <FeatureDataRow> selectedRows = EnumerateWhileMonitoringClientConnection(layer.SelectedFeatures); foreach (FeatureDataRow selectedFeature in selectedRows) { FeatureStyle style = getStyleForFeature(layer, selectedFeature, layerStyle); IEnumerable renderedFeature = renderer.RenderFeature(selectedFeature, style, RenderState.Selected, layer); View.ShowRenderedObjects(renderedFeature); } break; case RenderPhase.Highlighted: IEnumerable <FeatureDataRow> highlightedRows = EnumerateWhileMonitoringClientConnection(layer.HighlightedFeatures); foreach (FeatureDataRow highlightedFeature in highlightedRows) { FeatureStyle style = getStyleForFeature(layer, highlightedFeature, layerStyle); IEnumerable renderedFeature = renderer.RenderFeature(highlightedFeature, style, RenderState.Highlighted, layer); View.ShowRenderedObjects(renderedFeature); } break; default: break; } renderer.CleanUp(); }
public static void Composite() { Phase = RenderPhase.Compositing; spriteBatch.Begin(SpriteSortMode.Immediate, null, null, null, null, fxComposite, null); }