Added some functionality for plugins that want to render in other editing modes

This commit is contained in:
codeimp 2010-08-22 12:09:32 +00:00
parent 6a685b7678
commit 603cdbf042
6 changed files with 12 additions and 0 deletions

View file

@ -102,6 +102,9 @@ namespace CodeImp.DoomBuilder.Editing
// Panning
public bool IsPanning { get { return panning; } }
// Rendering
public IRenderer2D Renderer { get { return renderer; } }
#endregion
#region ================== Constructor / Disposer

View file

@ -322,6 +322,7 @@ namespace CodeImp.DoomBuilder.Plugins
// Rendering events
public virtual void OnEditRedrawDisplayBegin() { }
public virtual void OnEditRedrawDisplayEnd() { }
public virtual void OnPresentDisplayBegin() { }
#endregion
}

View file

@ -300,6 +300,7 @@ namespace CodeImp.DoomBuilder.Plugins
public void OnEditMouseInput(Vector2D delta) { foreach(Plugin p in plugins) p.Plug.OnEditMouseInput(delta); }
public void OnEditRedrawDisplayBegin() { foreach(Plugin p in plugins) p.Plug.OnEditRedrawDisplayBegin(); }
public void OnEditRedrawDisplayEnd() { foreach(Plugin p in plugins) p.Plug.OnEditRedrawDisplayEnd(); }
public void OnPresentDisplayBegin() { foreach(Plugin p in plugins) p.Plug.OnPresentDisplayBegin(); }
#endregion
}

View file

@ -202,6 +202,8 @@ namespace CodeImp.DoomBuilder.Rendering
// This draws the image on screen
public void Present()
{
General.Plugins.OnPresentDisplayBegin();
// Start drawing
if(graphics.StartRendering(true, General.Colors.Background.ToColorValue(), graphics.BackBuffer, graphics.DepthBuffer))
{

View file

@ -767,6 +767,8 @@ namespace CodeImp.DoomBuilder.Rendering
// This finishes rendering
public void Finish()
{
General.Plugins.OnPresentDisplayBegin();
// Done
graphics.FinishRendering();
graphics.Present();

View file

@ -86,6 +86,9 @@ namespace CodeImp.DoomBuilder.VisualModes
public bool ProcessGeometry { get { return processgeometry; } set { processgeometry = value; } }
public bool ProcessThings { get { return processthings; } set { processthings = value; } }
public VisualBlockMap BlockMap { get { return blockmap; } }
// Rendering
public IRenderer3D Renderer { get { return renderer; } }
#endregion