unit Mipmaps;

interface

uses Windows, SysUtils, GL, GLu, GLext, WGLext, GLtools, Textures;

procedure GenerateMipmap(tex: TTexture; OnOff: GLboolean);

implementation

var
  GL_SGIS_generate_mipmap_loaded: boolean = false;

procedure GenerateMipmap;
begin
  if not GL_SGIS_generate_mipmap_loaded then
  begin
    if not glext_ExtensionSupported('GL_SGIS_generate_mipmap') then
         raise Exception.Create('GL_SGIS_generate_mipmap required!');
    GL_SGIS_generate_mipmap_loaded := true;
  end;
  tex.Parameteri(GL_GENERATE_MIPMAP_SGIS, OnOff);
end;

end.
