The problems is that enums are determined at compile time, while the values returned by glGenTextures cannot be assumed to have any pattern. Therefore trying to get texture IDs into enums is the wrong approach (by definition).

Why not simply make an int[], and store the texture IDs in them. Then use the enums to refer to a slot in the array.

The problems is that enums are determined at compile time, while the values returned by glGenTextures cannot be assumed to have any pattern. Therefore trying to get texture IDs into enums is the wrong approach (by definition).

Why not simply make an int[], and store the texture IDs in them. Then use the enums to refer to a slot in the array.

hi,if you want some help on an international forum like here, you absolutely have to take the habit to write your code in English. I was willing to help here but when I saw that your code was in a language I don't understand, I just stopped trying as it would have been too painful ... and I think it will be the same for most people of this forum.

you're always binding texture id 0 which is quite the same as disabling textures

Texture 0 is a perfectly valid texture id, and refers to the single texture unit from OpenGL 1.0. It's just not usually a very good to use it. It's most definitely not the same thing as disabling textures, only glDisable does that.

you're always binding texture id 0 which is quite the same as disabling textures

Texture 0 is a perfectly valid texture id, and refers to the single texture unit from OpenGL 1.0. It's just not usually a very good to use it. It's most definitely not the same thing as disabling textures, only glDisable does that.

probably true, but srsly, are you really calling glDisable() everytime you want to disable texturing? You have to admit you are using glBindTexture(GL_TEXTURE_2D, 0);

you're always binding texture id 0 which is quite the same as disabling textures

Texture 0 is a perfectly valid texture id, and refers to the single texture unit from OpenGL 1.0. It's just not usually a very good to use it. It's most definitely not the same thing as disabling textures, only glDisable does that.

probably true, but srsly, are you really calling glDisable() everytime you want to disable texturing? You have to admit you are using glBindTexture(GL_TEXTURE_2D, 0);

You cannot count on texture 0 having any particular default data in it. Typically it's white, but on some GPUs/drivers, people have told me it's black. I don't usually have much need to disable texturing. For times when I do need a solid color, I generate a white pixmap or I work a white square into the atlas, which is more so I can treat that solid block like any other tile. Otherwise it's not that expensive to disable as long as you're not doing it a zillion times per frame.

When do you really need to disable texturing in fixed function? Using a 1x1 white TextureRegion from your current sprite sheet has the same effect.

You shouldn't need to use glDisable (which can lead to performance problems) or bind texture 0 (which might have unusual results on shitty drivers). Just bind your white texture region whenever you want a "solid" or "untextured" primitive. And as a bonus, you won't even need to flush your sprite batch.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org