(bind-func texture_setup
(lambda (tex)
(glActiveTexture GL_TEXTURE0)
(glBindTexture GL_TEXTURE_2D tex)
(glTexImage2D GL_TEXTURE_2D
0
GL_RED
4 2 ;; texture is 4x2 float
0
GL_RED
GL_FLOAT
(convert texture_data))
(glTexParameteri GL_TEXTURE_2D GL_TEXTURE_WRAP_S GL_CLAMP_TO_EDGE)
(glTexParameteri GL_TEXTURE_2D GL_TEXTURE_WRAP_T GL_CLAMP_TO_EDGE)
(glTexParameteri GL_TEXTURE_2D GL_TEXTURE_MIN_FILTER GL_NEAREST)
(glTexParameteri GL_TEXTURE_2D GL_TEXTURE_MAG_FILTER GL_NEAREST)
(gl_print_error "in texture_setup")))