コード例 #1
0
ファイル: Driver.cs プロジェクト: slagusev/FusionGameEngine
 /// <summary>
 ///		Sets up a new instance of this class with the given values.
 /// </summary>
 /// <param name="renderControl">Control to render to.</param>
 /// <param name="flags">Flags to setup this control with.</param>
 public GraphicsCanvas(Control renderControl, GraphicsFlags flags, CanvasRenderHandler handler)
 {
     _renderControl  = renderControl;
     _graphicsCanvas = GraphicsManager.Driver.CreateCanvas(renderControl, flags);
     if (handler != null)
     {
         _renderDelegate += handler;                  // Fix this so its removed when canvas is destroyed!.
     }
     _driver = GraphicsManager.Driver;
     GraphicsManager.RenderTarget = this;
 }
コード例 #2
0
 /// <summary>
 ///		Sets up a new instance of this class with the given values.
 /// </summary>	
 /// <param name="renderControl">Control to render to.</param>
 /// <param name="flags">Flags to setup this control with.</param>
 public GraphicsCanvas(Control renderControl, GraphicsFlags flags, CanvasRenderHandler handler)
 {
     _renderControl = renderControl;
     _graphicsCanvas = GraphicsManager.Driver.CreateCanvas(renderControl, flags);
     if (handler != null) _renderDelegate += handler; // Fix this so its removed when canvas is destroyed!.
     _driver = GraphicsManager.Driver;
     GraphicsManager.RenderTarget = this;
 }
コード例 #3
0
ファイル: Manager.cs プロジェクト: slagusev/FusionGameEngine
        /// <summary>
        ///		Creates a canvas that can be rendered to by the current driver.
        /// </summary>
        /// <param name="control">Control to render this canvases graphics to.</param>
        /// <returns>New renderable canvas.</returns>
        public static GraphicsCanvas CreateCanvas(Control control, GraphicsFlags flags, CanvasRenderHandler handler)
        {
            GraphicsCanvas canvas = new GraphicsCanvas(control, flags, handler);

            ClearRenderState();
            return(canvas);
        }
コード例 #4
0
 /// <summary>
 ///		Creates a canvas that can be rendered to by the current driver.
 /// </summary>
 /// <param name="control">Control to render this canvases graphics to.</param>
 /// <returns>New renderable canvas.</returns>
 public static GraphicsCanvas CreateCanvas(Control control, GraphicsFlags flags, CanvasRenderHandler handler)
 {
     GraphicsCanvas canvas = new GraphicsCanvas(control, flags, handler);
     ClearRenderState();
     return canvas;
 }