Skip to main content
gamedev.net
🔒 Locked

gl textures array

Started by Sammy0037 3 replies 550+ views
Original Post
Sammy0037
Sammy0037
hi I just want to see if I understand this correctly. If I put 5 textures in an array, the numbers inside each element are arbitrary? Ex: image[1] could be 2 and image [5] could be 3? Then the number inside is the one used to point to the correct texturename(integer)? glGenTextures(1, ℑ[5]); glBindTexture(GL_TEXTURE_2D, image[5]); will bind to texture #3? thx
python_regious
python_regious
Quote:
Original post by Sammy0037
glBindTexture(GL_TEXTURE_2D, image[5]); will bind to texture #3?


If image[5] holds the OpenGL texture ID for what you have decided to be "texture #3", then yes.
If at first you don't succeed, redefine success.
Daaark
Daaark
Image 5 would be going out of your array bounds. You have 0-4.
python_regious
python_regious
Quote:
Original post by Vampyre_Dark
Image 5 would be going out of your array bounds. You have 0-4.


[lol] So true. Ok, insert "If image[5] exists" before the rest of my previous post [smile].
If at first you don't succeed, redefine success.
Sammy0037
Sammy0037
ooops, yes 5 should have been 4. Thx, explains several things.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.