how to load and bind a texture?

i want my shaders to set a texture on an object. but i don’t know how to load a texture and bind it to my shaders. I read a bit in the internet but i got confused. I hope someone can help me. Thanks for all

glUniform1i() - you specify which texture-unit slot to use (0…15).

Thanks for your fast answer. This is how I’d do it now.


But I don’t know what I am suppose to write in BindTexture. I read that it has to be an integer. I mean, I have to load it somewhere, or does this happen with the specification of the texture unit. Hope you understand my confusion

You need to pass texture ID there. Read the manual…

The texture handle (for your “earth texture”). You got it from glGenTextures. And you had to bind it to specify texture data for it (e.g. through glTexImage2D, etc.)

Gee, thank you all. I got it know!