using OpenTK.Graphics.OpenGL; using System.Drawing; namespace ConsoleApp1 { class FrontTextView { OpenTK.Graphics.TextPrinter text = new OpenTK.Graphics.TextPrinter(OpenTK.Graphics.TextQuality.High); float size1 = 25; float size2 = 15; Font printerFont1; Font printerFont2; string poem = "Oxford Dictionaries definitions. Looking for the meanings of words, phrases, and expressions? We provide hundreds of thousands of definitions, synonyms, antonyms, and pronunciations for English and other languages, derived from our language research and expert analysis. We also offer a unique set of examples of real usage, as well as guides to: Writing help: This section gives guidelines on writing in everyday situations, from applying for a job to composing letters of ..."; public FrontTextView() { } public void Render(int Width, int Height) { // ******** font settings size1 = Height / 30f; size2 = Height / 60f; printerFont1 = new Font(FontFamily.GenericMonospace, size1); printerFont2 = new Font(FontFamily.GenericSerif, size2, FontStyle.Regular); // FontFamily.GenericSansSerif //******** GL.MatrixMode(MatrixMode.Projection); GL.PushMatrix(); // 上書きするなら必要 GL.LoadIdentity(); GL.MatrixMode(MatrixMode.Modelview); GL.PushMatrix(); // 上書きするために必要 GL.LoadIdentity(); GL.Viewport(0, 0, Width, Height); GL.Ortho(0, Width, Height, 0, -1, 1); // 射影変換 その他Perspectiveもある // ******** Text Rendering text.Begin(); text.Print(this.BaseText, printerFont1, Color.DimGray, drawRect, OpenTK.Graphics.TextPrinterOptions.NoCache); text.End(); // ******** This is equivalent: GL.MatrixMode(MatrixMode.Modelview); GL.PopMatrix(); GL.MatrixMode(MatrixMode.Projection); GL.PopMatrix(); } } }