2

I would like to remember a current texture state in OpenGL 1.x and later restore it. I can use glIsEnabled to check which texture types are active.

  1. Does it make sense to have enabled more than one text type, for example, GL_TEXTURE_2D and GL_TEXTURE_CUBE_MAP?

glGet* function allows to get a current texture id, for example, GL_TEXTURE_BINDING_2D but to bind previous texture I also need to know appropriate target for glBindTexture.

  1. How to achieve it?
t.niese
  • 39,256
  • 9
  • 74
  • 101
Irbis
  • 1,432
  • 1
  • 13
  • 39
  • How do you use `glIsEnabled` to check `which texture types are active`? – t.niese Oct 13 '19 at 17:32
  • bool texture2dEnabled = glIsEnabled(GL_TEXTURE_2D); – Irbis Oct 13 '19 at 17:49
  • Do you use OpenGL 2? Because since OpenGL 3.0 `GL_TEXTURE_2D` is not a valid value for `glIsEnabled`. – t.niese Oct 13 '19 at 17:56
  • Yes, even 1.X, please see question title. – Irbis Oct 13 '19 at 17:59
  • 1
    Sorry I overlook that. I update the title, question, and tags to be specific about that. – t.niese Oct 13 '19 at 18:06
  • @Irbis yes it does make sense to enable more texture types... its called multi texturing and CUBE_MAPS where often used as background reflection or fast normalization for bump mapping in the old days without GLSL ... – Spektre Oct 14 '19 at 07:43

0 Answers0