public static void UnitTest()
    {
        OpenGL theOpenGL = new OpenGL();

        Sphere theSphere = new Sphere();

        theSphere.SetRenderEngine(theOpenGL);

        BorderDecorator theSphereWithBorder = new BorderDecorator(theSphere);

        theSphereWithBorder.SetRenderEngine(theOpenGL);
        theSphereWithBorder.Draw();
    }
Example #2
0
    //
    void UnitTest_Shape()
    {
        OpenGL theOpenGL = new OpenGL();

        // 圓型
        Sphere theSphere = new Sphere();

        theSphere.SetRenderEngine(theOpenGL);

        //在圖型加外框
        BorderDecorator theSphereWithBorder = new BorderDecorator(theSphere);

        theSphereWithBorder.SetRenderEngine(theOpenGL);
        theSphereWithBorder.Draw();
    }