How to draw text using only OpenGL methods?

后端 未结 6 1373
暗喜
暗喜 2020-11-28 02:05

I don\'t have the option to use but OpenGL methods (that is glxxx() methods). I need to draw text using gl methods only. After reading the red book, I understan

6条回答
  •  日久生厌
    2020-11-28 02:52

    enter image description here

    Use glutStrokeCharacter(GLUT_STROKE_ROMAN, myCharString).

    An example: A STAR WARS SCROLLER.

    #include 
    #include 
    #include 
    #include 
    #include 
    
    GLfloat UpwardsScrollVelocity = -10.0;
    float view=20.0;
    
    char quote[6][80];
    int numberOfQuotes=0,i;
    
    //*********************************************
    //*  glutIdleFunc(timeTick);                  *
    //*********************************************
    
    void timeTick(void)
    {
        if (UpwardsScrollVelocity< -600)
            view-=0.000011;
        if(view < 0) {view=20; UpwardsScrollVelocity = -10.0;}
        //  exit(0);
        UpwardsScrollVelocity -= 0.015;
      glutPostRedisplay();
    
    }
    
    
    //*********************************************
    //* printToConsoleWindow()                *
    //*********************************************
    
    void printToConsoleWindow()
    {
        int l,lenghOfQuote, i;
    
        for(  l=0;l

提交回复
热议问题