hedgewars/uRender.pas
changeset 12886 a089326f0e16
parent 12885 dab60d247b75
child 12898 8a40ce061d94
equal deleted inserted replaced
12885:dab60d247b75 12886:a089326f0e16
    66 {$ENDIF}
    66 {$ENDIF}
    67 procedure RenderSetClearColor   (r, g, b, a: real);
    67 procedure RenderSetClearColor   (r, g, b, a: real);
    68 procedure Tint                  (r, g, b, a: Byte); inline;
    68 procedure Tint                  (r, g, b, a: Byte); inline;
    69 procedure Tint                  (c: Longword); inline;
    69 procedure Tint                  (c: Longword); inline;
    70 procedure untint(); inline;
    70 procedure untint(); inline;
    71 procedure setTintAdd            (f: boolean); inline;
    71 procedure setTintAdd            (enable: boolean); inline;
    72 
    72 
    73 // call this to finish the rendering of current frame
    73 // call this to finish the rendering of current frame
    74 procedure FinishRender();
    74 procedure FinishRender();
    75 
    75 
    76 function isAreaOffscreen(X, Y, Width, Height: LongInt): boolean; inline;
    76 function isAreaOffscreen(X, Y, Width, Height: LongInt): boolean; inline;
  1967     if cWhiteColor = LastTint then exit;
  1967     if cWhiteColor = LastTint then exit;
  1968     openglTint($FF, $FF, $FF, $FF);
  1968     openglTint($FF, $FF, $FF, $FF);
  1969     LastTint:= cWhiteColor;
  1969     LastTint:= cWhiteColor;
  1970 end;
  1970 end;
  1971 
  1971 
  1972 procedure setTintAdd(f: boolean); inline;
  1972 procedure setTintAdd(enable: boolean); inline;
  1973 begin
  1973 begin
  1974     if f then
  1974     {$IFDEF GL2}
       
  1975         if enable then
       
  1976             glUniform1i(glGetUniformLocation(shaderMain, pchar('tintAdd')), 1)
       
  1977         else
       
  1978             glUniform1i(glGetUniformLocation(shaderMain, pchar('tintAdd')), 0);
       
  1979     {$ELSE}
       
  1980     if enable then
  1975         glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD)
  1981         glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD)
  1976     else
  1982     else
  1977         glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
  1983         glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
       
  1984     {$ENDIF}
  1978 end;
  1985 end;
  1979 
  1986 
  1980 procedure ChangeDepth(rm: TRenderMode; d: GLfloat);
  1987 procedure ChangeDepth(rm: TRenderMode; d: GLfloat);
  1981 var tmp: LongInt;
  1988 var tmp: LongInt;
  1982 begin
  1989 begin