本文整理匯總了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());
}
示例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());
}
示例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;
}
示例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);
}