opcon/QuickFont

How show graph and text on GLControl ?

always0108 opened this issue · 1 comments

I want to show a rectangle and some text on a GLControl panel,but it doesn't work,the panel only show the text. What should I do to slove it?

`//图形
GL.Disable(EnableCap.Texture2D);
GL.Color3(Color.Black);
GL.Begin(BeginMode.LineLoop);
GL.Vertex2(300, 100);
GL.Vertex2(300, 50);
GL.Vertex2(400, 50);
GL.Vertex2(400, 100);
GL.End();

qfont = new QFont("C:\Windows\Fonts\tahoma.ttf", 50, new QuickFont.Configuration.QFontBuilderConfiguration(true));
qdraw = new QFontDrawing();
qdraw.ProjectionMatrix = _projectionMatrix;
QFontRenderOptions textOpts;
textOpts = new QFontRenderOptions()
{
Colour = Color.Red, //Color.DarkRed, etc
DropShadowActive = false
};
qdraw.DrawingPrimitives.Clear();
qdraw.Print(qfont, "Hello world", new Vector3(100f,100f,0f), QFontAlignment.Left,textOpts);
qdraw.RefreshBuffers();
qdraw.Draw();
//Add this
qdraw.DisableShader();

glControl1.SwapBuffers();`

I just solved it, after "qdraw.Draw();" should add "qdraw.DisableShader();".