0
votes

I was looking at OpenGL examples and before creating object these two examples follow different ways. What are the differences between these two examples?

1)

glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D,myImg);

glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D,myImg2);

2)

glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, _textureId[0]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);  
1

1 Answers

2
votes

in first example we activate two unit and assign one texture to each unit.but sample 2 is different .it enables 2D texture mapping on current active layer and set filtering parameters.the key concept is texture unit in OpenGL.