GLuint textureID; glGenTextures(1, &textureID); glBindTexture(GL_TEXTURE_2D, textureID); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, data); glGenerateMipmap(GL_TEXTURE_2D);
glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBindTexture(GL_TEXTURE_2D, textureID1); glDrawArrays(GL_TRIANGLES, 0, 6); glBindTexture(GL_TEXTURE_2D, textureID2); glDrawArrays(GL_TRIANGLES, 0, 6); glDisable(GL_BLEND);In this example, we enable blending and set the blending function to be source alpha and one minus source alpha. We then bind the first texture to the 2D texture target and draw geometry using the `glDrawArrays` function. We repeat the process with the second texture and then disable blending. Package/Library: OpenGL Overall, Texture is a commonly used feature in computer graphics and is often implemented in graphics APIs such as OpenGL and DirectX.