Пример #1
0
        private void DrawTextScrn(int font, DrawBrush brush, Vector3d a, Vector3d xdir, Vector3d ydir, string s, double imgScale, DrawTextOption opt)
        {
            Start2D();

            FontTex tex = mFontFaceW.CreateTexture(s);

            Vector3d xv = xdir.UnitVector() * tex.ImgW * imgScale;
            Vector3d yv = ydir.UnitVector() * tex.ImgH * imgScale;

            if ((opt.Option & DrawTextOption.H_CENTER) != 0)
            {
                a -= (xv / 2);
            }

            if (xv.IsZero() || yv.IsZero())
            {
                return;
            }

            GL.Color4(brush.Color4());

            mFontRenderer.Render(tex, a, xv, yv);

            End2D();
        }
Пример #2
0
        private void DrawHeFaces(DrawBrush brush, HeModel model)
        {
            if (brush.IsNullBrush)
            {
                return;
            }

            EnableLight();

            for (int i = 0; i < model.FaceStore.Count; i++)
            {
                HeFace f = model.FaceStore[i];

                HalfEdge head = f.Head;

                HalfEdge c = head;

                GL.Begin(PrimitiveType.Polygon);
                GL.Color4(brush.Color4());

                if (f.Normal != HeModel.INVALID_INDEX)
                {
                    Vector3d nv = model.NormalStore[f.Normal];
                    GL.Normal3(nv);
                }

                for (; ;)
                {
                    GL.Vertex3((model.VertexStore.Ref(c.Vertex).vector *DC.WorldScale));

                    c = c.Next;

                    if (c == head)
                    {
                        break;
                    }
                }

                GL.End();
            }

            DisableLight();
        }
Пример #3
0
        public void DrawText(int font, DrawBrush brush, Vector3d a, Vector3d xdir, Vector3d ydir, DrawTextOption opt, string s)
        {
            a *= DC.WorldScale;

            FontTex tex = mFontFaceW.CreateTexture(s);

            Vector3d xv = xdir.UnitVector() * tex.ImgW * 0.15;
            Vector3d yv = ydir.UnitVector() * tex.ImgH * 0.15;

            if (xv.IsZero() || yv.IsZero())
            {
                return;
            }

            if ((opt.Option & DrawTextOption.H_CENTER) != 0)
            {
                a -= (xv / 2);
            }

            GL.Color4(brush.Color4());

            mFontRenderer.Render(tex, a, xv, yv);
        }
Пример #4
0
 public void Clear(DrawBrush brush)
 {
     GL.ClearColor(brush.Color4());
     GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
 }