anchor.diff:    '#version 330 core'#13#10+
     'const vec4 eps = vec4(0.009, 0.009, 0.009, 0.009);'+
     'const vec4 maskColor = vec4(1.0, 1.0, 0.0, 0.0);'+
  -  'uniform usampler2DRect bitmap;'+
  +  'uniform usampler2D bitmap;'+
     'uniform sampler1D palette;'+
     'uniform int useTexture = 0;'+
     'uniform int usePalette = 0;'+
  
positive.code: procedure BindUncompressedPaletted(ATextureId: GLuint; w, h: Int32;
    ARawImage: Pointer);
  begin
    glBindTexture(GL_TEXTURE_RECTANGLE, ATextureId);
  
    glTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_WRAP_S, GL_REPEAT);
    glTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_WRAP_T, GL_REPEAT);
  
    glTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
    glTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
  
    //glTexImage2D(GL_TEXTURE_RECTANGLE, 0,GL_LUMINANCE,w,h,0,GL_RED, GL_UNSIGNED_BYTE, ARawImage);
  
    glTexImage2D(GL_TEXTURE_RECTANGLE, 0,GL_R8UI,w,h,0,GL_RED_INTEGER, GL_UNSIGNED_BYTE, ARawImage);
  
     CheckGLErrors('Bind paletted');
  end;
  
negative.code: procedure BindRGBA(ATextureId: GLuint; w, h: Int32; ARawImage: Pointer; AInternalFormat: GLEnum); inline;
  begin
  
    glBindTexture(GL_TEXTURE_2D, ATextureId);
  
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  
    glTexImage2D(GL_TEXTURE_2D, 0,AInternalFormat,w,h,0,GL_RGBA, GL_UNSIGNED_BYTE, ARawImage);
  
  end;
  
  