内容へ移動
FiFiWiki2
FiFiWikiの第2版
ユーザ用ツール
ログイン
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ログイン
>
最近の変更
メディアマネージャー
サイトマップ
現在位置:
top
»
c.sharp
»
opentk_graphics_textprinter
c.sharp:opentk_graphics_textprinter
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
OpenTK.Comtibility.dllを使用した OpenTK.Graphics.TextPrinterは メモリリークの可能性があるため使用を中断 備忘録としてコードは残す ```c using OpenTK.Graphics.OpenGL; using System; using System.Drawing; namespace TapVisualizer1.Views { class FrontTextView { string BaseText = ""; OpenTK.Graphics.TextPrinter text = new OpenTK.Graphics.TextPrinter(OpenTK.Graphics.TextQuality.High); public void AddTxt(string txt) { this.BaseText += txt; } public void ClearTxt() { this.BaseText = ""; } public void Render(int Width, int Height, RectangleF drawRect) { // ******** Font settings float size1 = Height / 50f; size1 = (float)Math.Min(size1, 15); Font printerFont1 = new Font(FontFamily.GenericMonospace, size1); //******** Camera 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); // 画面内の座標 // ******** 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(); // ******** End printerFont1.Dispose(); } } } ```
c.sharp/opentk_graphics_textprinter.txt
· 最終更新: 2018/04/27 22:41 by
fifi
ページ用ツール
文書の表示
以前のリビジョン
バックリンク
ページの名称変更
文書の先頭へ