コード例 #1
0
        public static void Draw()
        {
            lock (BackgroundLock)
                lock (PagesLock)
                {
                    GLLocationPagesRendererContext context = new GLLocationPagesRendererContext
                    {
                        WindowX             = WindowX,
                        WindowY             = WindowY,
                        FirstAnswer         = FirstAnswer,
                        LastAnswer          = LastAnswer,
                        DefaultAnswer       = DefaultAnswer,
                        CancelAnswer        = CancelAnswer,
                        SymbolRenderer      = _fontRenderer,
                        Background          = _background,
                        CursorImage         = _cursorTexture,
                        DisabledCursorImage = _disabledCursorTexture,
                    };

                    if (_pages.IsNullOrEmpty())
                    {
                        GLLocationPageRenderer renderer = new GLLocationPageRenderer(0, context, null);
                        renderer.DrawBackground();
                    }
                    else
                    {
                        GLLocationPageRenderer[] renderers = new GLLocationPageRenderer[_pages.Length];
                        for (int i = 0; i < renderers.Length; i++)
                        {
                            renderers[i] = new GLLocationPageRenderer(i, context, _pages[i]);
                            renderers[i].DrawBackground();
                            renderers[i].CalcWindowSize();
                        }

                        foreach (GLLocationPageRenderer renderer in renderers)
                        {
                            renderer.DrawWindow();
                        }

                        GL.Enable(EnableCap.Blend);
                        GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
                        foreach (GLLocationPageRenderer renderer in renderers)
                        {
                            renderer.DrawText();
                        }
                        GL.Disable(EnableCap.Blend);
                    }
                }
        }
コード例 #2
0
 public GLLocationPageRenderer(int index, GLLocationPagesRendererContext context, string text)
 {
     _y       = index * ScreenHeight;
     _context = context;
     _text    = text == null ? null : text.ToCharArray();
 }