OpenGL Super Bible! Page 451 basically because texture (Web server extensions)
OpenGL Super Bible! Page 451 basically because texture mapping on a standard PC is too slow for animation. When the user isn t flying around (or drawing, for that matter), we want to draw with the textures. We will take care of this with a little conditional code and a few lighting parameters. Also, because drawing the textured scene will be slower than the fly-through scene, we need to provide some feedback to the user that our program is doing something. For simplicity, we ll just draw to the front buffer (the visible one) when texturing, and to the back buffer (the invisible one for animation) when flying or drawing. This way, when the program updates the textured scene, the user will see the image being drawn. You ll learn more about buffers in Chapter 15. The RepaintWindow function handles redrawing the terrain for the user. It starts off by selecting the front or back buffer (as described just above). Then it clears the color and depth bits, as follows: glViewport(0, 0, rect->right, rect->bottom); glClearColor(0.5, 0.5, 1.0, 1.0); glEnable(GL_DEPTH_TEST); if (Moving || Drawing) { glDisable(GL_TEXTURE_2D); glDrawBuffer(GL_BACK); } else { glEnable(GL_TEXTURE_2D); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); glDrawBuffer(GL_FRONT); }; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); After this, RepaintWindow draws in the sky. For performance reasons, the sky is only drawn when the user is not flying over or drawing the terrain. Since the background is cleared to a light blue, this isn t really a problem. The sky is shaped like a pyramid and has the SKY.BMP texture image mapped to it for a nice, cloudy blue sky. Once the sky is drawn, RepaintWindow starts drawing the terrain. The algorithm used is quite simple and basically generates strips of quadrilaterals (squares) along the terrain points. Each strip uses a different texture or lighting material color, so we have to issue glBegin/glEnd calls for each one. See Figure 12-6 for a graphical depiction of the algorithm.
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.