Using OpenGL glutDisplayFunc within class

后端 未结 4 761
清歌不尽
清歌不尽 2020-12-04 16:13

I\'ve created a C++ class (myPixmap) to encapsulate the work performed by the OpenGL GLUT toolkit. The display() member function of the class cont

4条回答
  •  一个人的身影
    2020-12-04 16:19

    I had trouble in understanding the correct answer from Merlyn, so here it is the simplified version:

    In myPixmap.h, change display function to static member function. Should work.

    class myPixmap
    {
      //...
      static void display();
      //...
    };
    

提交回复
热议问题