Computer Aided Automation
Simple way to display texts inside openGL 3d/2d world - Printable Version

+- Computer Aided Automation (https://computeraidedautomation.com)
+-- Forum: CAA Discussions (https://computeraidedautomation.com/forum-7.html)
+--- Forum: Visualization (https://computeraidedautomation.com/forum-13.html)
+--- Thread: Simple way to display texts inside openGL 3d/2d world (/thread-34.html)



Simple way to display texts inside openGL 3d/2d world - techberth - 18-12-2019

Code:
glRasterPos2i(0, 0);
    std::string s = "Some text";
    void * font = GLUT_BITMAP_9_BY_15;

    for (std::string::iterator i = s.begin(); i != s.end(); ++i)
    {
        char c = *i;
        glutBitmapCharacter(font, c);
    }
    glEnable(GL_TEXTURE_2D);