OpenGL Super Bible! Page 441 Table 12-1 Texture (Web hosting providers)

OpenGL Super Bible! Page 441 Table 12-1 Texture Image Filters Filter Description GL_NEAREST Nearest-neighbor filtering. GL_LINEAR Linear interpolation. GL_NEAREST_MIPMAP_NEAREST Nearest-neighbor mipmapped filtering. GL_NEAREST_MIPMAP_LINEAR Linear interpolated mipmaps. GL_LINEAR_MIPMAP_NEAREST Linear interpolation of mipmaps. Linear interpolation of interpolated GL_LINEAR_MIPMAP_LINEAR mipmaps. GL_NEAREST filtering takes the closest pixel in the texture image rather than interpolating between pixels. You ll learn more about mipmap filtering later in the chapter. Defining 2D Textures To define a 2D texture image in OpenGL, you call glTexImage2D. The glTexImage2D function takes a height argument in addition to the ones that glTexImage1D uses, as follows: void glTexImage2D(GLenum target, GLint level, GLint components, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) Like glTexImage1D, the width and height arguments must be a power of 2. Listing 12-2 shows how to load a sky texture image complete with clouds. Listing 12-2 Defining a 2D texure image void LoadAllTextures(void) { BITMAPINFO *info; /* Bitmap information */ void *bits; /* Bitmap pixel bits */ GLubyte *rgb; /* Bitmap RGB p ixels */ /* * Try loading the bitmap and converting it to RGB */
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.

Leave a Reply