當前位置: 首頁>>代碼示例>>C#>>正文


C# OpenGL.DrawText方法代碼示例

本文整理匯總了C#中SharpGL.OpenGL.DrawText方法的典型用法代碼示例。如果您正苦於以下問題:C# OpenGL.DrawText方法的具體用法?C# OpenGL.DrawText怎麽用?C# OpenGL.DrawText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SharpGL.OpenGL的用法示例。


在下文中一共展示了OpenGL.DrawText方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: drawMaze

        private void drawMaze(OpenGL gl)
        {
            if (dataModel.MazeStructure.Origin != null)
            {
                //  Draw a coloured pyramid.
                gl.Begin(OpenGL.GL_TRIANGLES);

                gl.Color(0.0f, 1.0f, 0.0f);

                float x = dataModel.MazeStructure.Origin.Coordinates.X;
                float y = dataModel.MazeStructure.Origin.Coordinates.Y;
                float z = 1.0f;

                gl.Vertex(x, y, z);

                gl.DrawText(0, 0, 128.0f, 128.0f, 128.0f, "Arial", 12.0f, "Drawing maze");

                /*
                gl.Color(1.0f, 0.0f, 0.0f);
                gl.Vertex(0.0f, 1.0f, 0.0f);
                gl.Color(0.0f, 1.0f, 0.0f);
                gl.Vertex(-1.0f, -1.0f, 1.0f);
                gl.Color(0.0f, 0.0f, 1.0f);
                gl.Vertex(1.0f, -1.0f, 1.0f);
                gl.Color(1.0f, 0.0f, 0.0f);
                gl.Vertex(0.0f, 1.0f, 0.0f);
                gl.Color(0.0f, 0.0f, 1.0f);
                gl.Vertex(1.0f, -1.0f, 1.0f);
                gl.Color(0.0f, 1.0f, 0.0f);
                gl.Vertex(1.0f, -1.0f, -1.0f);
                gl.Color(1.0f, 0.0f, 0.0f);
                gl.Vertex(0.0f, 1.0f, 0.0f);
                gl.Color(0.0f, 1.0f, 0.0f);
                gl.Vertex(1.0f, -1.0f, -1.0f);
                gl.Color(0.0f, 0.0f, 1.0f);
                gl.Vertex(-1.0f, -1.0f, -1.0f);
                gl.Color(1.0f, 0.0f, 0.0f);
                gl.Vertex(0.0f, 1.0f, 0.0f);
                gl.Color(0.0f, 0.0f, 1.0f);
                gl.Vertex(-1.0f, -1.0f, -1.0f);
                gl.Color(0.0f, 1.0f, 0.0f);
                gl.Vertex(-1.0f, -1.0f, 1.0f);
                */
                gl.End();
            }

            if (dataModel != null)
                gl.DrawText(0, 0, 128.0f, 128.0f, 128.0f, "Arial", 12.0f, dataModel.SolverAgentList.Count.ToString());
        }
開發者ID:DeanThomas1983,項目名稱:Maze2012,代碼行數:49,代碼來源:SharpGLForm.cs

示例2: Draw

 //Draw the level(score or a hud)
 public override void Draw(OpenGL gl)
 {
     gl.DrawText(100, 100, 1f, 1f, 1f, "verdana", 20, _time.ToString());
 }
開發者ID:Vinic,項目名稱:TomatoEngine,代碼行數:5,代碼來源:TimedLevel.cs

示例3: Draw

 public void Draw(OpenGL gl)
 {
     _starDrawTime.Reset();
     _starDrawTime.Start();
     if (StartupComplete)
     {
         renderEngine.RenderObjects(gl, GameObjects.ToArray());
         if (Paused)
         {
             gl.DrawText(100, 100, 1f, 1f, 1f, "verdana", 20, "Paused");
         }
     }
     else
     {
         gl.DrawText(100, 100, 1f, 1f, 1f, "verdana", 20, "Loading");
     }
     if (_level != null)
     {
         _level.Draw(gl);
     }
     _starDrawTime.Stop();
     DrawTime = (int)_starDrawTime.ElapsedMilliseconds;
 }
開發者ID:Vinic,項目名稱:TomatoEngine,代碼行數:23,代碼來源:TomatoMainEngine.cs

示例4: ModelRotater

        //  private float angleX = 0.0f, angleY = 0.0f, angleZ = 0.0f, x = 1;
        //  private int counter = 0;
        private void ModelRotater(OpenGL testObject)
        {
            testObject.Rotate(cord.getX(), 1.0f, 0.0f, 0.0f); //cord.getX()
            testObject.Rotate(cord.getZ(), 0.0f, 1.0f, 0.0f); //cord.getZ()
            testObject.Rotate(cord.getY(), 0.0f, 0.0f, 1.0f); //cord.getY()

            int h, w;
            h = openGLControl.Size.Height / 4;
            w = (openGLControl.Size.Width * 4) / 5;
            string text = "x: " + cord.getX().ToString(); // +", " + ComInput.osY.ToString() + ", " + ComInput.osZ.ToString();
            testObject.DrawText(w, h, 1, 1, 1, "faceName", 20, text);

            h = openGLControl.Size.Height / 5;
            text = "y: " + cord.getY().ToString();
            testObject.DrawText(w, h, 1, 1, 1, "faceName", 20, text);

            h = (openGLControl.Size.Height * 3) / 20;
            text = "z: " + cord.getZ().ToString();
            testObject.DrawText(w, h, 1, 1, 1, "faceName", 20, text);

            h = openGLControl.Size.Height / 10;
            text = "Work time: " + ComInput.fl.ToString();
            testObject.DrawText(w, h, 1, 1, 1, "faceName", 20, text);
        }
開發者ID:ulqiorra,項目名稱:Gyroscope,代碼行數:26,代碼來源:SharpGLForm.cs


注:本文中的SharpGL.OpenGL.DrawText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。