glut or glaux?????

Can anybody tell me how glut can be used instead of glaux for loading a bmp as a texture? I’ll need the code for the same. I have a code with glaux which does this though not quite successfully.

PLeeeeeeeeeeeeaaaaaase Help!!!


GLUT has no functions at all for managing textures.

Bob’s right: GLUT has NO tex-management functions, nor are .bmp files exactly the best format to use – I use .raw files: which are generally smaller, easier to get, and(for space freeks), very compressible.
I’ll post a routine as soon as I can(Monday, probably…)
Big disadvantages, however, with .raw files are that you need to know everything about them – height, width, depth, colours, RGB/BGR, etc…


/* Other includes here…/
#include <stdio.h>
#include <Gl/glut.h>
…and here. /

Declaration of function. */
void load_texture(char file_name, int width, int height, int depth, GLenum colour_type, GLenum filter_type);

Actual function. */
void load_texture(char *file_name, int width, int height, int depth, GLenum colour_type, GLenum filter_type)
GLubyte *raw_bitmap;
FILE *file;
if((file = fopen(file_name, “rb”))==NULL)
printf("File Not Found : %s
", file_name);
raw_bitmap = (GLubyte *) malloc (width * height * depth * (sizeof(GLubyte)));
if(raw_bitmap == NULL)
printf("Cannot allocate memory for texture
fread(raw_bitmap, width * height * depth, 1 , file);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter_type);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter_type);
gluBuild2DMipmaps(GL_TEXTURE_2D, colour_type, width, height, colour_type, GL_UNSIGNED_BYTE, raw_bitmap);

A standard call(for a 256*256 linear RGB texture) would be something like this…
load_texture(“earth_r.raw”, 256, 256, 3, GL_RGB, GL_LINEAR);
NB: This is NOT my code, all the same: I hope it helps
Note also that I’ve got no idea if this works with multi-texturing: I’ve no idea as to that subject, so I guess it dosen’t…

Of course it works with multitexturing, why shouldn’t it? That function is just for loading the texture, not using it.

dont use GLAUX check the faq’s even the makers(sgi) of glaux say dont use it but to use glut instead.

for loading textures ild recommend loads tga,jpg,bmp,png etc very simple to setup and use.
include the library an example of its use is in my opengl appwizard (glut part) only works on vc6 at the moment

Well, like I said: I’ve no idea as to how multitexturing works, as far as I know, the textures could be loaded individually into a dynamic array in VRAM, pointed to by a dword hex number… or they could just be loaded, one at a time from disk, each and every time they’re needed…I suspect that this method works with the latter(slower) process, but it’s unlikly to work with any other method.