;; get texture height
;; for TEXTURE_RECTANGLE only!
(bind-func gl_tex_height_rect
(lambda (tex)
(glDisable GL_TEXTURE_2D)
(glEnable GL_TEXTURE_RECTANGLE_ARB)
(glBindTexture GL_TEXTURE_RECTANGLE_ARB tex)
(let ((v:|1,i32|* (salloc)))
(glGetTexLevelParameteriv GL_TEXTURE_RECTANGLE_ARB 0 GL_TEXTURE_HEIGHT (cast v))
(glDisable GL_TEXTURE_RECTANGLE_ARB)
(glBindTexture GL_TEXTURE_RECTANGLE_ARB 0)
(aref v 0))))