   OpenGL question
  Hi, I was reading neHe's opengl tutorialsMy question is if all the drawings needs to be done in only one function?or can two different functions in 2 different classes draw stuff onto the screen?Is there like a prefered method?   
Quote:Original post by ShowHi, I was reading neHe's opengl tutorialsMy question is if all the drawings needs to be done in only one function?or can two different functions in 2 different classes draw stuff onto the screen?Is there like a prefered method?Where the drawing is done is simply a design issue; there are no requirements as to where such code must be located.   ;  There is one main drawing loop, but each object in your scene can use it's own drawing function. In the nehe tutorials, the main drawing loop is that while (window is still valid) {...} part of the win32 code. In there, there is some type of DrawScene() function call. From within there, you can call whatever else you want. As jyk said, it's really a design issue as to what is rendered where.I like to have each class render the object it is supposed to represent, and then have some type of graphics manager that manages the render calls of the other objects.   ;  From my understanding, anything done before the SwapBuffers() (on Win32 system) gets drawn.  Where you have the glBegin/glEnd/etc, doesn't really matter (design issue).   