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
You cannot translate inside a glBegin/glEnd
block, you have break it up into two blocks.
I recommend to start using glGetError()
in your code, it will help you find mistakes like this.
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.