06-21-2002, 12:13 PM
I am reading "OpenGL Super Bible" by Richard Wright. I am trying to understand how to put bitmap as texture on the object. The example in chapter 12 "pencil" works OK with the bitmap provided by the book. But after I modified the size of the bitmap, the texture didn't work any more. Is there any relation between the size of the object they draw
and the size of the bitmap as texture? below are the functions used to load the bitmap.
thanks a lot.
jim
GLubyte * /* O - Bitmap data */
LoadDIBitmap(const char *filename, /* I - File to load */
BITMAPINFO **info) /* O - Bitmap information */
GLuint /* O - Texture object or 0 on error */
TextureLoad(char *filename, /* I - Bitmap file to load */
GLboolean alpha, /* I - Generate alpha for bitmap */
GLenum minfilter, /* I - Minification filter */
GLenum magfilter, /* I - Magnification filter */
GLenum wrap) /* I - Repeat or clamp */
PencilTexture = TextureLoad("pencil.bmp", GL_FALSE, GL_LINEAR, GL_LINEAR,
GL_REPEAT);
and the size of the bitmap as texture? below are the functions used to load the bitmap.
thanks a lot.
jim
GLubyte * /* O - Bitmap data */
LoadDIBitmap(const char *filename, /* I - File to load */
BITMAPINFO **info) /* O - Bitmap information */
GLuint /* O - Texture object or 0 on error */
TextureLoad(char *filename, /* I - Bitmap file to load */
GLboolean alpha, /* I - Generate alpha for bitmap */
GLenum minfilter, /* I - Minification filter */
GLenum magfilter, /* I - Magnification filter */
GLenum wrap) /* I - Repeat or clamp */
PencilTexture = TextureLoad("pencil.bmp", GL_FALSE, GL_LINEAR, GL_LINEAR,
GL_REPEAT);