Beispiel #1
0
        public DrawingGL(DrawContextGL dc)
        {
            DC = dc;

            mFontFaceW = new FontFaceW();
            //mFontFaceW.SetFont(@"C:\Windows\Fonts\msgothic.ttc", 0);
            mFontFaceW.SetResourceFont("/Fonts/mplus-1m-regular.ttf");
            mFontFaceW.SetSize(24);

            mFontRenderer = new FontRenderer();
            mFontRenderer.Init();

            FontTex tex = mFontFaceW.CreateTexture("X");

            FontTexW = tex.ImgW;
            FontTexH = tex.ImgH;
        }
Beispiel #2
0
        private void OnLoad(object sender, EventArgs e)
        {
            GL.ClearColor(Color4.Black);
            GL.Enable(EnableCap.DepthTest);

            mDrawContextOrtho = new DrawContextGLOrtho(this);
            mDrawContextOrtho.SetupTools(SettingsHolder.Settings.DrawMode);

            mDrawContextPers = new DrawContextGLPers(this);
            mDrawContextPers.SetupTools(SettingsHolder.Settings.DrawMode);

            mDrawContext = mDrawContextOrtho;

            mDrawContextOrtho.PushToViewAction = PushToFront;
            mDrawContextPers.PushToViewAction  = PushToFront;

            SwapBuffers();
        }
Beispiel #3
0
        public void EnablePerse(bool enable)
        {
            if (enable)
            {
                if (mDrawContext != mDrawContextPers)
                {
                    mDrawContext = mDrawContextPers;
                }
            }
            else
            {
                if (mDrawContext != mDrawContextOrtho)
                {
                    mDrawContext = mDrawContextOrtho;
                }
            }

            if (mDrawContext == null)
            {
                return;
            }

            mDrawContext.SetViewSize(Size.Width, Size.Height);
        }