maybe check what MaxTex is set too when the error happens
glGetIntegerv(GL_MAX_TEXTURE_UNITS, Varptr(MaxTex))
might be getting the wrong result?
manually setting it at 1 or 2....
glGetIntegerv(GL_MAX_TEXTURE_UNITS, Varptr(MaxTex))
might be getting the wrong result?
manually setting it at 1 or 2....