Re: [Plib-users] using triangles
Brought to you by:
sjbaker
|
From: Steve B. <sjb...@ai...> - 2002-03-25 13:17:30
|
sa...@sa... wrote: > I tried to parse everything out, except that triangle. It still didn't > work. Here is code from that parsed version > http://www.saunalahti.fi/~saparti/samitest.cpp OK - I'll take a look at it. > I still wonder, what would be a correct order when I have those ships > and other things in there too. > > Example: > void redraw (){ > update_motion () ; > glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ) ; > ssgCullAndDraw ( scene ) ; > glutPostRedisplay () ; > glutSwapBuffers () ; > } > > Should I put those raw opengl things between ssgCullAndDraw line and > glutPostRedisplay line? Yes. > Is that glutSwapBuffers that command, which throw those raw opengl > things to the screen? These might be some newbie guestions, but from > somewhere everyone should start :) The screen is a chunk of memory holding the pixels and the Z values - right? Well, in OpenGL there are TWO chunks of pixel memory - one for the screen that you are looking at on the CRT and the other for the one that you are drawing into. When you have completely finished drawing, the picture you were drawing is swapped with the one you *were* looking at so now you are looking at the new one and the old one is 'recycled' to be used as the next place to draw into. (That's an oversimplification - but not in any respect that matters) ----------------------------- Steve Baker ------------------------------- Mail : <sjb...@ai...> WorkMail: <sj...@li...> URLs : http://www.sjbaker.org http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net http://freeglut.sf.net http://toobular.sf.net http://lodestone.sf.net |