예제 #1
0
        public static void Set(int w, int h)
        {
            GL.ClearColor(System.Drawing.Color.AliceBlue);
            GL.Enable(EnableCap.DepthTest);
            AppInfo.W    = w;
            AppInfo.H    = h;
            AppInfo.RW   = w;
            AppInfo.RH   = h;
            AppInfo.Full = false;
            AppInfo.App  = "GLApp";
            if (!done)
            {
                Import.Import.RegDefaults();
            }
            SetVP.Set(0, 0, w, h);
            GL.Scissor(0, 0, w, h);
            GL.Disable(EnableCap.Blend);
            GL.Disable(EnableCap.Texture2D);
            GL.Enable(EnableCap.CullFace);
            GL.CullFace(CullFaceMode.Back);
            GL.Disable(EnableCap.StencilTest);
            GL.Disable(EnableCap.ScissorTest);
            GL.Enable(EnableCap.DepthTest);
            GL.DepthRange(0, 1);

            GL.ClearDepth(1.0f);
            GL.DepthFunc(DepthFunction.Less);
            // UI.UISys.ActiveUI.OnResize(Width, Height);
            Pen2D.SetProj(0, 0, w, h);
            if (!done)
            {
                Pen2D.InitDraw();
            }
            AppInfo.W  = w;
            AppInfo.H  = h;
            AppInfo.RW = w;
            AppInfo.RH = h;

            SetVP.Set(0, 0, w, h);
            GL.Scissor(0, 0, w, h);
            GL.Disable(EnableCap.Blend);
            GL.Disable(EnableCap.Texture2D);
            GL.Enable(EnableCap.CullFace);
            GL.CullFace(CullFaceMode.Back);
            GL.Disable(EnableCap.StencilTest);
            GL.Disable(EnableCap.ScissorTest);
            // GL.Disable(EnableCap.Lighting);

            //GL.DepthFunc(DepthFunction.Greater);

            GL.Enable(EnableCap.DepthTest);
            GL.DepthRange(0, 1);

            GL.ClearDepth(1.0f);
            GL.DepthFunc(DepthFunction.Lequal);

            Pen2D.SetProj(0, 0, w, h);

            done = true;
        }
예제 #2
0
파일: UIForm.cs 프로젝트: Hengle/Fusion3D
 public void DrawFormSolid(Vector4 col, int x = 0, int y = 0, int w = -1, int h = -1)
 {
     if (w == -1)
     {
         w = W;
         h = H;
     }
     Pen2D.Rect(GX + x, GY + y, w, h, col * UI.BootAlpha);
 }
예제 #3
0
 public static void SetSize(int w, int h)
 {
     AppInfo.W  = w;
     AppInfo.H  = h;
     AppInfo.RW = w;
     AppInfo.RH = h;
     GL.Viewport(0, 0, w, h);
     GL.Scissor(0, 0, w, h);
     Pen2D.SetProj(0, 0, w, h);
 }
예제 #4
0
        public static void Draw(Font2D font, string text, int x, int y, Vector4 col)
        {
            int dx = x;

            Pen2D.BlendMod = PenBlend.Alpha;
            foreach (char c in text)
            {
                VGlyph cg = font.Glypth[c];
                Pen2D.Rect(dx, y, cg.W, cg.H, cg.Img, col);
                dx += (int)(cg.W / 1.3f);
            }
        }
예제 #5
0
파일: UIForm.cs 프로젝트: Hengle/Fusion3D
        public void DrawForm(Texture2D tex, Vector4 col, int x = 0, int y = 0, int w = -1, int h = -1)
        {
            Pen2D.BlendMod = PenBlend.Alpha;

            int dw = W;
            int dh = H;

            if (w != -1)
            {
                dw = w;
                dh = h;
            }

            Pen2D.Rect(GX + x, GY + y, dw, dh, tex, col * UI.BootAlpha);
        }
예제 #6
0
        public void Render()
        {
            if (GeneratedGeo == false)
            {
                GenerateGeo();
            }
            float a = 0;

            float ai = 1.0f / (float)RenW;

            for (int x = 0; x < RenW; x++)
            {
                Pen2D.Rect(RenX + x, RenY, 2, RenH, new OpenTK.Vector4(a, a, a, 1.0f));

                a += ai;
            }
        }
예제 #7
0
파일: UIForm.cs 프로젝트: Hengle/Fusion3D
        public void DrawFormBlur(Texture2D tex, float blur, Vector4 col, int x = 0, int y = 0, int w = -1, int h = -1)
        {
            Pen2D.BlendMod = PenBlend.Alpha;

            int dw = W;
            int dh = H;

            if (w != -1)
            {
                dw = w;
                dh = h;
            }

            Texture2D btex = new Texture2D(dw, dh);

            btex.CopyTex(GX + x, App.FusionApp.H - ((GY + y) + dh));

            Pen2D.RectBlur(GX + x, GY + y, dw, dh, tex, btex, col * UI.BootAlpha, col * UI.BootAlpha, blur);

            btex.Delete( );
        }
예제 #8
0
        public void DrawFormBlurRefract(Texture2D tex, Texture2D norm, float blur, Vector4 col, float refract, int x = 0, int y = 0, int w = -1, int h = -1)
        {
            return;

            Pen2D.BlendMod = PenBlend.Alpha;

            int dw = W;
            int dh = H;

            if (w != -1)
            {
                dw = w;
                dh = h;
            }

            Texture2D btex = new Texture2D(dw, dh);

            btex.CopyTex(GX + x + OffX, App.VividApp.H - ((GY + y + OffY) + dh));

            Pen2D.RectBlurRefract(GX + x + OffX, GY + y + OffY, dw, dh, tex, btex, norm, col * UI.BootAlpha, col * UI.BootAlpha, blur, refract);

            btex.Delete();
        }
예제 #9
0
파일: UIForm.cs 프로젝트: Hengle/Fusion3D
        public void DrawLine(int x, int y, int x2, int y2, OpenTK.Vector4 col)
        {
            Pen2D.BlendMod = PenBlend.Solid;

            Pen2D.Line(GX + x, GY + y, GX + x2, GY + y2);
        }