Texture memory issue

When I call the initialise texture function in my game(load bmp & tga), the color of the opengl primitives changes (blue turns black, white turns brown). If i disable the texture loading, the problem is fixed. I am not using the glBind function as this is the only one used.

has anyone had this problem before and if so, how would it be fixed?

Thanks

BennUK

I’m pretty sure it’s not a memory issue.

What’s your texture environment state?
For example if you have modulate, then the result will be primarytexture or primarytexture+secondary

I don’t know what you mean by the ‘state’. I am quite new to OpenGl and am trying to implement as simple a texture loader as I can but still keep having this problem.How would I find out what the state is?

Thanks again

BennUK

Originally posted by BennUK:
I am quite new to OpenGl and …
Which means you should probably be posting to the beginner’s forum.

My guess is that you call a GL function in the constructor of a class. And you have a static or global object that gets instantiated before you have a device context and rendering context.

But that’s a shot in the dark without more information.

Another possibility is that the data is presented to OpenGL in some other byte format than that which is described to OpenGL (i e, GL_BGRA, GL_RGB, etc).

I agree that the beginner’s section is the place for this question.