genColorTexture textureUnitNo width height = do
  tex <- genObjectName 
  withTexturesAt Texture2D [(tex,textureUnitNo)] $ do
    texImage2D Texture2D NoProxy 0 RGBA'
             (TextureSize2D width height) 0
             (PixelData RGBA UnsignedByte nullPtr) 
    textureFilter Texture2D $= ((Nearest, Nothing), Nearest)
    texture2DWrap $= (Repeated, ClampToEdge)
    --textureBorderColor Texture2D $= Color4 1.0 0.0 0.0 (0.0::GLfloat)
    --textureMaxAnisotropy Texture2D $= 1.0
  return tex
genColorTexture textureUnitNo width height = do
  tex <- genObjectName 
  withTexturesAt Texture2D [(tex,textureUnitNo)] $ do
    texImage2D Texture2D NoProxy 0 RGBA'
             (TextureSize2D width height) 0
             (PixelData RGBA UnsignedByte nullPtr) 
    textureFilter Texture2D $= ((Nearest, Nothing), Nearest)
    texture2DWrap $= (Repeated, ClampToEdge)
    --textureBorderColor Texture2D $= Color4 1.0 0.0 0.0 (0.0::GLfloat)
    --textureMaxAnisotropy Texture2D $= 1.0
  return tex
genColorTexture textureUnitNo width height = do
  tex <- genObjectName 
  withTexturesAt Texture2D [(tex,textureUnitNo)] $ do
    texImage2D Texture2D NoProxy 0 RGBA'
             (TextureSize2D width height) 0
             (PixelData RGBA UnsignedByte nullPtr) 
    textureFilter Texture2D $= ((Nearest, Nothing), Nearest)
    texture2DWrap $= (Repeated, ClampToEdge)
    --textureBorderColor Texture2D $= Color4 1.0 0.0 0.0 (0.0::GLfloat)
    --textureMaxAnisotropy Texture2D $= 1.0
  return tex