Exemplo n.º 1
0
        private static void renderFontInfo()
        {
            Gl.glMatrixMode(Gl.GL_PROJECTION);
            Gl.glLoadIdentity();
            Glu.gluOrtho2D(0f, (float)w_win, 0f, (float)h_win);
            Gl.glMatrixMode(Gl.GL_MODELVIEW);
            Gl.glLoadIdentity();

            // draw mode
            Gl.glColor3f(1.0f, 1.0f, 1.0f);
            Gl.glRasterPos2f(20.0f, h_win - (20.0f + infoFont.Ascender()));

            switch (mode)
            {
            case mode_t.EDITING:
                infoFont.Render("Edit Mode");
                break;

            case mode_t.INTERACTIVE:
                break;
            }

            // draw font type
            Gl.glRasterPos2i(20, 20);
            switch (current_font)
            {
            case FTGL_BITMAP:
                infoFont.Render("Bitmap Font");
                break;

            case FTGL_PIXMAP:
                infoFont.Render("Pixmap Font");
                break;

            case FTGL_OUTLINE:
                infoFont.Render("Outline Font");
                break;

            case FTGL_POLYGON:
                infoFont.Render("Polygon Font");
                break;

            case FTGL_EXTRUDE:
                infoFont.Render("Extruded Font");
                break;

            case FTGL_TEXTURE:
                infoFont.Render("Texture Font");
                break;
            }

            Gl.glRasterPos2f(20.0f, 20.0f + infoFont.LineHeight());
            infoFont.Render(fontName);
        }
Exemplo n.º 2
0
        public void Draw(string text, Vector2f position, Color4f color)
        {
            string[] rows = text.Split('\n');

            Gl.glPushMatrix();
            Gl.glColor4f(color.r, color.g, color.b, color.a);
            Gl.glTranslatef(position.x, position.y, 0.0f);
            for (int i = 0; i < rows.Length; i++)
            {
                font.Render(rows[i]);
                Gl.glTranslatef(0.0f, -fontSize, 0.0f);
            }
            Gl.glPopMatrix();
        }