title: glTextureStorage3D and glTextureSubImage3D are not working
body: <p>I would like to use multiple textures, but stucking.
  I tried to bind multiple textures with using, <code>glTextureStorage3D</code> and <code>glTextureSubImage3D</code>.
  I wrote following code by Kotlin.</p>
  <pre class="lang-kotlin prettyprint-override"><code>
      // generate textureId
      val tex = BufferUtils.createIntBuffer(1).run {
          glCreateTextures(GL_TEXTURE_2D_ARRAY, this)
          this.get(0)
      }
  
      // using STBImage, retrieve image file's width, height and bytebuffer
      val textures = texturePaths.mapIndexed { idx, texture -&gt;
          loadTexture(idx, tex, texture)
      }
  
      glTextureStorage3D(
              tex,
              1,
              GL_RGB,
              textures.maxBy { it.width }!!.width,
              textures.maxBy { it.height }!!.height,
              textures.size
      )
  
      textures.forEach { texture -&gt;
          glTextureSubImage3D(tex,
                  0,
                  0,
                  0,
                  texture.index,
                  texture.width,
                  texture.height,
                  1,
                  GL_RGBA,
                  GL_UNSIGNED_BYTE,
                  texture.img
          )
      }
      ...
  }
  
  private fun loadTexture(idx: Int, tex: Int, texture: String): Texture {
  
      val width = BufferUtils.createIntBuffer(1)
      val height = BufferUtils.createIntBuffer(1)
      val comp = BufferUtils.createIntBuffer(1)
      val img: ByteBuffer = STBImage.stbi_load(texture, width, height, comp, STBImage.STBI_default)
              ?: throw IllegalStateException(&quot;Failed to load $texture&quot;)
  
      logger.debug(&quot;$texture load OK&quot;)
      val texObj = Texture(idx, width.get(0), height.get(0), comp.get(0), img)
  
      STBImage.stbi_image_free(img)
  
      return texObj
  }
  
  </code></pre>
  <p>After executed <code>glBindTexture</code> and call <code>glGetTexImage</code> by texureId, no image data returned.
  I referred following SO post.
  <a href="https://stackoverflow.com/a/5117806/2565527">https://stackoverflow.com/a/5117806/2565527</a></p>
  <p>How to bind textures correctly ?</p>