How To change Display recursively In Open GL



  • My altercell function changes array "m" . So I want this process to repeat again again and print points based on bool value of m . How I can call it recursively?
    Any Help will be appreciated.

    @void MyPanelOpenGL::paintGL()
    {

    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glLoadIdentity();
    
    //    static float i(0.01),j(0.007);
     //
    //int set[Size];
    //setInt(set);
    float length= 0.9/Size;
      glColor3f(0.0f, 1.9f, 0.0f);
    
    
       altercell();
    

    for(int i=0;i<rows;i++)
    {//cout<<"\t\t";
    for(int j=0;j<cols;j++)
    {
    glBegin(GL_POINTS);

       if(m[i][j]==1)
           glVertex2f(x+(2*i+1)*length,j);
     
       glEnd();
      // paintGL();
       }
       }
    

    }
    @


  • Lifetime Qt Champion

    Hi,

    Which version of Qt are you using ?

    You could use the timer event to call your alterCell() function followed by update()

    Hope it helps


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.