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; }
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(); }
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); }