Skip to content
gregory-diaz edited this page Mar 12, 2014 · 11 revisions
  • In Visual Studio create a new project
  • 'Add Existing Project' to the solution (all of the following projects are needed)
    • agg/Agg.csproj
    • Csg/Csg.csproj (Todo: should not be needed, used by RenderOpenGL)
    • Gui/Gui.csproj (give us our gui on top of Agg)
    • OpenGlGui/OpenGlGui.csproj (Todo: should not be needed, used by PlatfromWin32)
    • PlatformWin32/PlatformWin32.csproj (used to get a Windows Forms surface)
    • RenderOpenGl/RenderOpenGl.csproj (Todo: should not be needed, used by OpenGlGui)
    • Tesselate/Tesselate.csproj (Todo: should not be needed, used by RenderOpenGl)
    • VectorMath/VectorMath.csproj (used by agg internally)
    • PolygonMesh/PolygonMesh.csproj
  • Type in the following code
using System;
using MatterHackers.Agg.UI;
using MatterHackers.Agg;
using MatterHackers.Agg.Font;

namespace MatterHackers.Agg
{
    public class HelloWorld : SystemWindow
    {
        public HelloWorld()
            : base(640, 480)
        {
            // add the text widget to show our message
            AddChild(new TextWidget("Hellow World", 320, 240, justification: Font.Justification.Center));
            ShowAsSystemWindow();
        }

        // and just for fun lets also draw a circle
        public override void OnDraw(Graphics2D graphics2D)
        {

            graphics2D.Circle(320, 100, 50, RGBA_Bytes.Blue);
            base.OnDraw(graphics2D);
        }

        [STAThread]
		public static void Main(string[] args)
		{
            new HelloWorld();
        }
    }
}
  • On 'HellowWorld' -> 'References' -> 'add 'Add Reference'

    • Agg.csproj
    • Gui.csproj
    • PlatformWin32.csproj
  • And Run it!

Clone this wiki locally