View Full Version : glDeleteTextures...

07-09-2003, 01:33 PM
OK, I can't find the Red or Blue books ANYWHERE anymore, and it's really got me ticked, because all I need to know is the fraggin' format of glDeleteTextures(). I have tried everything and it fails.

//the texture layout

typedef struct tagblah
short int numTextures;
int *Texture;
} blah;

blah *MyBlah;


glDeleteTextures(MyBlah->numTextures, MyBlah->Texture);

Why isn't this working? I have tried swapping the variable places, I've used references, I've even tried making the struct static! Nothing works and I can't reference the books anymore. There is one out there, but it totally sucks, has no search option, and is missing 50% of the functions I use, so I am assuming it is an old one.

07-09-2003, 08:50 PM
When you create texture id's for the texture objects -

GLuint textureid[5];

// generate texture id's
glGenTextures(5, textureid);

// create texture objects
glBindTexture(GL_TEXTURE_2D, textureid[0]);
// ... etc.

... then when you come to delete them -

glDeleteTextures(5, textureid);

I'm not sure why you have defined a struct around this. If you have your texture id's in anything other than an array of GLuint's then OpenGL won't work correctly anyway.

Can you post the code where you initialise this struct?

[This message has been edited by Rog (edited 07-09-2003).]