glTranslatef not working within glBegin .. glEnd

前端 未结 2 749
感情败类
感情败类 2021-01-22 07:41

I\'m trying to draw 2 squares side by side of different colours, my problem is I can\'t get glTranslatef to move my second square to the right, the second square just draws over

2条回答
  •  别那么骄傲
    2021-01-22 08:36

    Only a certain subset of OpenGL commands is allowed between glBegin and glEnd. So, when you call glTranslate between those two calls, it is ignored.

    Remove glBegin and glEnd from display, and put in drawSquare - that should work.

提交回复
热议问题